I want to test application slices , but there is a package that I want to exclude, since it is not associated with these tests at all.
I am trying to exclude a package as follows:
@RunWith(SpringRunner.class) @WebMvcTest(controllers = MyController.class, excludeFilters = {@ComponentScan.Filter( type = FilterType.REGEX, pattern = "com.foo.bar.*")}) public class MyControllerTest {
Classes from this package are included in the context anyway. How to fix it?
source share