use of org.springframework.data.mongodb.core.mapping.MongoMappingContext in project spring-boot by spring-projects.
the class ReactiveMongoRepositoriesAutoConfigurationTests method testDefaultRepositoryConfiguration.
@Test
public void testDefaultRepositoryConfiguration() throws Exception {
prepareApplicationContext(TestConfiguration.class);
assertThat(this.context.getBean(ReactiveCityRepository.class)).isNotNull();
MongoClient client = this.context.getBean(MongoClient.class);
assertThat(client).isInstanceOf(MongoClient.class);
MongoMappingContext mappingContext = this.context.getBean(MongoMappingContext.class);
@SuppressWarnings("unchecked") Set<? extends Class<?>> entities = (Set<? extends Class<?>>) ReflectionTestUtils.getField(mappingContext, "initialEntitySet");
assertThat(entities).hasSize(1);
}
Aggregations