I want to write a WebMvcTest
test for a single controller in my Spring Boot application. Among other things there are some custom Converters
in my application. Although they are not needed for this particular controller that I want to test, Spring tries to create them anyway.
Now the problem: those custom converters require more beans from my application which are not initialised by WebMvcTest
test slice. And don't want to mock tens of beans which are completely irrelevant for the particular test. Apart from specifying them all manually in excludeFilters
, what are best practises for excluding some web components from specific WebMvcTest
tests?