junit报错Found multiple @SpringBootConfiguration annotated classes
有可能是因为依赖的jar包中有springboot启动类,junit不知道加载哪个启动类,需要在junit的@SpringBootTest注解上指定启动类。
@RunWith(SpringRunner.class)
@SpringBootTest(classes = {App.class})
@WebAppConfiguration
public class ApplicationTests {
@Test
public void contextLoads() {
}