samedi 21 décembre 2019

DAO Layer test: java.lang.IllegalStateException: Configuration error: found multiple declarations of @BootstrapWith for test class

I try to run test for my DAO Layer with Spring Boot. But I receive java.lang.IllegalStateException: Configuration error: found multiple declarations of @BootstrapWith for test class [com.example.demo.FoodDaoIntegrationTest]

I've read a couple of answers to this error, but it still hasn't helped. I guess there is still some kind of problem with annotations. My test is:

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() {

Aucun commentaire:

Enregistrer un commentaire