Provide module-scoped equivalents to @WebMvcTest and @DataJpaTest
See original GitHub issueWith @WebMvcTest
and @DataJpaTest
we can easily create an ApplicationContext for the web- or data layer of our Spring Boot Application.
It would be nice to have equivalents to these annotations that only include the web- or data layer of our module under test into the ApplicationContext.
Same goes for the other annotations like @WebfluxTest
, @JdbcTest
and so on (see https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-testing.html).
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:25
Top Results From Across the Web
SpringBootTest Vs @WebMvcTest & @DataJpaTest &service ...
I have a SpringBoot MVC application, and I want to cover it with tests. I have the controller, service and repository layers. What...
Read more >Testing MVC Web Controllers with Spring Boot and ...
An in-depth look at the responsibilities of a Spring Boot web controller and how to cover those responsibilities with meaningful tests.
Read more >40. Testing - Spring
Spring Boot provides a number of utilities and annotations to help when testing your application. Test support is provided by two modules; spring-boot-test ......
Read more >Difference between @WebMvcTest and @DataJpaTest in ...
The @DataJpaTest annotation in Spring Boot is used to test the persistence layer components that autoconfigure in-memory embedded databases and look for @Entity ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks like @sbrannen was kind enough to add support for an escape hatch by adding an explicit annotation on the test class in Spring Framework 5.1.
Would you mind giving this another look on 5.1, @thombergs?
I just realized that the test works when I specify all three together
But what does this mean for the bootsrapping? Does it initialize the whole application or only the current module?