【发布时间】:2016-11-16 08:48:45
【问题描述】:
我想test application slices,但我想排除一个包,因为它与那些测试完全无关。
我正在尝试以这种方式排除包:
@RunWith(SpringRunner.class)
@WebMvcTest(controllers = MyController.class,
excludeFilters = {@ComponentScan.Filter(
type = FilterType.REGEX, pattern = "com.foo.bar.*")})
public class MyControllerTest {
// ... list of test methods goes here ...
}
这个包中的类无论如何都包含在上下文中。如何解决?
【问题讨论】:
标签: java spring testing spring-boot