@DataJpaTest needing a class outside the test
In a SpringBoot application, I would like to do some test about the repository layer. @RunWith(SpringRunner.class) @DataJpaTest public class VisitRepositoryTest { @Autowired private TestEntityManager entityManager; @Autowired private VisitRepository visitRepository; ... } When I try to run test from VisitRepositoryTest , I get an error about DefaultConfigService Field defaultConfigService in com.norc.Application required a bean of type 'com.norc.service.DefaultConfigService' that could not be found. So this needs to run the Application ? I tried to put a bean of DefaultConfigService in