@Test public void testDefaultRepositoryConfiguration() throws Exception { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, "spring.datasource.initialize:false"); this.context.register(TestConfiguration.class, BaseConfiguration.class); this.context.refresh(); assertThat(this.context.getBean(CountryRepository.class)).isNotNull(); }
@Test public void testMixedRepositoryConfiguration() throws Exception { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, "spring.datasource.initialize:false"); this.context.register(MixedConfiguration.class, BaseConfiguration.class); this.context.refresh(); assertThat(this.context.getBean(CountryRepository.class)).isNotNull(); assertThat(this.context.getBean(CityRepository.class)).isNotNull(); }
@Test public void testMixedRepositoryConfigurationWithDeprecatedEntityScan() throws Exception { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, "spring.datasource.initialize:false"); this.context.register(MixedConfigurationWithDeprecatedEntityScan.class, BaseConfiguration.class); this.context.refresh(); assertThat(this.context.getBean(CountryRepository.class)).isNotNull(); assertThat(this.context.getBean(CityRepository.class)).isNotNull(); }
@Test public void testDefaultRepositoryConfiguration() throws Exception { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, "spring.datasource.initialize:false"); this.context.register(TestConfiguration.class, BaseConfiguration.class); this.context.refresh(); assertNotNull(this.context.getBean(CountryRepository.class)); }
@Test public void testMixedRepositoryConfiguration() throws Exception { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, "spring.datasource.initialize:false"); this.context.register(MixedConfiguration.class, BaseConfiguration.class); this.context.refresh(); assertNotNull(this.context.getBean(CountryRepository.class)); assertNotNull(this.context.getBean(CityRepository.class)); }