SpringBoot Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration

如异常所译,你需要在注解上加上

@SpringBootTest(classes = Application.class)
或者使用

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {JPAConfig.class})

or

@RunWith(SpringRunner.class)
@ContextConfiguration(classes = {JPAConfig.class})

or

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(value={"myJPAConfig.xml"})

or

@RunWith(SpringRunner.class)
@ContextConfiguration(value={"myJPAConfig.xml"})

阅读更多

没有更多推荐了,返回首页