0

I have a Spring Boot 2 application with an integration test like follows

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK, classes = ExchangeRateStoreApplication.class)
@AutoConfigureMockMvc
@Transactional
public class GenerateStrategyRatesTest {

    @TestConfiguration
    static class Config {

        @Bean
        JdbcPersistenceHelper jdbcPersistenceHelper(@Autowired EntityManager entityManager) {
            return new JdbcPersistenceHelper(entityManager);
        }
    }

    @Autowired
    MockMvc mvc;

    @Autowired
    EntityManager entityManager;

However, the @Autowired EntityManager in Config class is not being resolved by spring and I don't know why.

Am I missing something?

beni0888
  • 1,050
  • 1
  • 12
  • 40

0 Answers0