Found multiple @SpringBootConfiguration annotated classes [Generic bean: class [com.XXX

报错信息如下:

Found multiple @SpringBootConfiguration annotated classes [Generic bean: class [com.XXX_第1张图片

解决方案

出现这种现象的原因是 SpringBoot 没有找到主启动类的位置,解决方案是在 @SpringBootTest 注解上显式声明主启动类的位置,声明完成后,再执行即可正常运行单元测试。

@SpringBootTest(classes = SpringBootJUnitApplication.class)
public class OuterTest {
    
    @Test
    public void test4() throws Exception {
        System.out.println("Outer test run ......");
    }
}

你可能感兴趣的:(报错,log4j,bug)