如何使用 Spring 正确定义套件测试?

How do I properly define a Suite test with Spring?

所以我把我的套件设置成这样:

@RunWith(Suite.class)
@SuiteClasses({ 
    Foo1Test.class, 
    Foo2Test.class
    })
public class FooTest {

}

我的单元测试是这样的:

@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureMockMvc
public class Foo1Test {

    @Test
    public void test1() throws Exception {/*...*/}
}

一切都很好,除了我 运行 我的项目 mvn clean install 测试已经 运行 两次。我该如何预防?

在此处找到解决方案:

我将单元测试重命名为 *TestCase 并将套件保留为 *Test