I have a Spring application and in it I do not use xml configuration, only Java Config. Everything is OK, but when I try to test it I faced problems wi
What you need to do is:
remove @Repository
from ArticleRepository
add @EnableJpaRepositories
to PagesTestConfiguration.java
@Configuration
@ComponentScan(basePackages = {"com.example.core"}) // are you sure you wanna scan all the packages?
@EnableJpaRepositories(basePackageClasses = ArticleRepository.class) // assuming you have all the spring data repo in the same package.
public class PagesTestConfiguration {
@Bean
public ArticleServiceImpl articleServiceImpl() {
ArticleServiceImpl articleServiceImpl = new ArticleServiceImpl();
return articleServiceImpl;
}
}