spring-projects / spring-projects/spring-hateoas

Integrate Traverson to MockMvc tests

Open
#733 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
476
PR merge metrics
No merged PRs in 30d

Description

I typically write tests with MockMvc where you can set up expectations using very nice DSL.
Test is annotated with

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK)
@AutoConfigureMockMvc

Then I can autowire

@Autowired
MockMvc mvc

Then I can do mvc.perform(get("URI where I want to go"))
.andExpect(status().isOk()) and other expectations

"URI where I want to go" is concatenated list of resources and I thought I could start using Traverson to do navigation for me.

I thought I would be able to use it, but as of now I need fully-blown server.
Could you please extend Traverson to allow using it in MockMvc tests?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the Traverson API and the MockMvc setup shown in the issue, including @SpringBootTest, @AutoConfigureMockMvc, and mvc.perform. Define the integration boundary and verify that Traverson can navigate linked resources without requiring a fully running server.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
api, backend, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.