相关疑难解决方法(0)

如何在Spring Boot JUnit测试中排除*AutoConfiguration类?

我试过了:

@RunWith(SpringJUnit4ClassRunner.class)
@EnableAutoConfiguration(exclude=CrshAutoConfiguration.class)
@SpringApplicationConfiguration(classes = Application.class)
@WebAppConfiguration
public class LikeControllerTest {
Run Code Online (Sandbox Code Playgroud)

然而,CRaSSHD仍然启动.虽然目前它不会损害测试,但我想在单元测试期间禁用不必要的模块以加快速度并避免潜在的冲突.

java junit spring spring-boot

62
推荐指数
7
解决办法
11万
查看次数

标签 统计

java ×1

junit ×1

spring ×1

spring-boot ×1