I've simple Spring setup using @Inject
, @ComponentScan
and @EnableJpaRepositories
. There is currently no need to have specific @Configurations
for test, integration or production environments.
I'm now using the Spring test mvc framework and I'm introducing an @TestConfig
containing mocked beans for my (Spring Data) Repository classes which also have the @Primary annotation.
But the @EnableJpaRepositories
seems not to obey to the @Primary
for the repository beans in my TestConfig
.
Is there an easy way to solve this or should I really split everything up using specific profiles not enabling Spring Data JPA repositories?