【发布时间】:2020-04-13 16:19:56
【问题描述】:
我尝试使用 Spring Boot 为我的 DAO 层运行测试。但我收到
java.lang.IllegalStateException: Configuration error: found multiple declarations of @BootstrapWith for test class [com.example.demo.FoodDaoIntegrationTest]
我已经阅读了几个关于这个错误的答案,但仍然没有帮助。我想注释仍然存在某种问题。 我的测试是:
package com.example.demo;
@RunWith(SpringRunner.class) @DataJpaTest
@SpringBootTest(classes = com.project.application.DemoApplication.class)
@ContextConfiguration(classes = com.project.application.DemoApplication.class)
public class FoodDaoIntegrationTest {
@Autowired
private TestEntityManager entityManager;
@Autowired
private FoodDao mealDao;
@Test
public void TestSomething() {
【问题讨论】:
标签: java spring-boot testing spring-data-jpa dao