Java 类org.springframework.boot.autoconfigure.data.mongo.country.Country 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MongoDataAutoConfigurationTests.java   
@Test
@SuppressWarnings("unchecked")
public void entityScanShouldSetInitialEntitySet() throws Exception {
    this.context = new AnnotationConfigApplicationContext();
    this.context.register(EntityScanConfig.class,
            PropertyPlaceholderAutoConfiguration.class, MongoAutoConfiguration.class,
            MongoDataAutoConfiguration.class);
    this.context.refresh();
    MongoMappingContext mappingContext = this.context
            .getBean(MongoMappingContext.class);
    Set<Class<?>> initialEntitySet = (Set<Class<?>>) ReflectionTestUtils
            .getField(mappingContext, "initialEntitySet");
    assertThat(initialEntitySet).containsOnly(City.class, Country.class);
}