Java 类org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:JpaWebAutoConfigurationTests.java   
@Test
public void testDefaultRepositoryConfiguration() throws Exception {
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setServletContext(new MockServletContext());
    this.context.register(TestConfiguration.class,
            EmbeddedDataSourceConfiguration.class,
            HibernateJpaAutoConfiguration.class,
            JpaRepositoriesAutoConfiguration.class,
            SpringDataWebAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    assertThat(this.context.getBean(CityRepository.class)).isNotNull();
    assertThat(this.context.getBean(PageableHandlerMethodArgumentResolver.class))
            .isNotNull();
    assertThat(this.context.getBean(FormattingConversionService.class)
            .canConvert(Long.class, City.class)).isTrue();
}
项目:spring-boot-concourse    文件:JpaWebAutoConfigurationTests.java   
@Test
public void testDefaultRepositoryConfiguration() throws Exception {
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setServletContext(new MockServletContext());
    this.context.register(TestConfiguration.class,
            EmbeddedDataSourceConfiguration.class,
            HibernateJpaAutoConfiguration.class,
            JpaRepositoriesAutoConfiguration.class,
            SpringDataWebAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    assertThat(this.context.getBean(CityRepository.class)).isNotNull();
    assertThat(this.context.getBean(PageableHandlerMethodArgumentResolver.class))
            .isNotNull();
    assertThat(this.context.getBean(FormattingConversionService.class)
            .canConvert(Long.class, City.class)).isTrue();
}
项目:contestparser    文件:JpaWebAutoConfigurationTests.java   
@Test
public void testDefaultRepositoryConfiguration() throws Exception {
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setServletContext(new MockServletContext());
    this.context.register(TestConfiguration.class,
            EmbeddedDataSourceConfiguration.class,
            HibernateJpaAutoConfiguration.class,
            JpaRepositoriesAutoConfiguration.class,
            SpringDataWebAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    assertNotNull(this.context.getBean(CityRepository.class));
    assertNotNull(this.context.getBean(PageableHandlerMethodArgumentResolver.class));
    assertTrue(this.context.getBean(FormattingConversionService.class)
            .canConvert(Long.class, City.class));
}