Spring boot test SpringBootTest集成测试无法与多个(@SpringBootApplication)配合使用
我有一个SpringBootTest集成测试,用于我正在开发的某个框架,该框架使用jpa,它是通过SpringBootApplication安装的。 我添加了对不使用jpa的框架的支持,为此我需要创建一个不使用jpa的SpringBootApplication 现在,单独运行时的测试类工作得很好,但是当我一起运行它时(运行不同Spring应用程序的不同测试类),第二顺序测试类失败,因为我似乎没有在测试类之间重置上下文 我使用以下方法将测试分类:Spring boot test SpringBootTest集成测试无法与多个(@SpringBootApplication)配合使用,spring-boot-test,Spring Boot Test,我有一个SpringBootTest集成测试,用于我正在开发的某个框架,该框架使用jpa,它是通过SpringBootApplication安装的。 我添加了对不使用jpa的框架的支持,为此我需要创建一个不使用jpa的SpringBootApplication 现在,单独运行时的测试类工作得很好,但是当我一起运行它时(运行不同Spring应用程序的不同测试类),第二顺序测试类失败,因为我似乎没有在测试类之间重置上下文 我使用以下方法将测试分类: @RunWith(SpringRunner.cla
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ClassA.class, webEnviornemt ... etc)
@DirtiesContext (tried all the variations)
@ActiveProfiles("testA")
public class TestsA
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ClassB.class, webEnviornemt ... etc)
@DirtiesContext (tried all the variations)
@ActiveProfiles("testB")
public class TestsB
如果A类先运行,则B类失败,反之亦然
有没有关于为什么SpringBootTest不会切换类的建议?我没有看到@RunWithannotation@SimonMartinelli我的错。。编辑你能发布例外吗?我没有看到@RunWithannotation@SimonMartinelli我的错。。编辑你能发布例外情况吗?