spring-projects / spring-projects/spring-hateoas
Integrate Traverson to MockMvc tests
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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