为什么@SpringBootTest运行@SpringBootApplication并跳过@Test方法?

时间:2019-08-27 19:56:31

标签: spring-boot spring-boot-test

在此example的第7步之后,我为SpringBoot命令行应用程序创建了集成测试:

这是我的整合测试

@RunWith(SpringRunner.class)
@SpringBootTest
@TestPropertySource(locations = "classpath:application.integrationtest.properties")
public class IntegrationTest {

    @Autowired
    private RequestProcessor requestProcessor;


    @Test
    public void testRequestProcessor() {
        requestProcessor.setStandloneFlag(true);
        requestProcessor.processRequest();

    }
}

当我运行此测试时,它会启动@SpringBootApplication本身,但从不运行集成测试中的@Test方法。 docs说这不应该发生。

为什么@SpringBootTest忽略我的@Test方法并启动应用程序?

0 个答案:

没有答案