By default @DataJpaTest scans all jpa repositories and @Entity. In my case I have 5 repositories package and 5 entities package. E.g
com.acme.product.entity is associated with
com.acme.product.repository
com.acme.users.entity is associated with
com.acme.users.repository
com.acme.client.entity is associated with
com.acme.client.repository
And so on....
I would like to test each part in a separate classe. E.g.
@RunWith(SpringRunner.class)
@DataJpaTest
//Some configurations to import only product repositories and product entities
public class TestProductRepository {
@Autowired
TestEntityManager entityManager;
}
Note that I have configured 5 different EntityManager I would like to import them and use for example the productEntityManager in the TestProductRepository instead of the default TestEntityManager which loads all repositories/entites.
Thanks a lot