本文整理汇总了Java中org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java SpringDataWebAutoConfiguration类的具体用法?Java SpringDataWebAutoConfiguration怎么用?Java SpringDataWebAutoConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpringDataWebAutoConfiguration类属于org.springframework.boot.autoconfigure.data.web包,在下文中一共展示了SpringDataWebAutoConfiguration类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDefaultRepositoryConfiguration
import org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration; //导入依赖的package包/类
@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();
}
示例2: testDefaultRepositoryConfiguration
import org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration; //导入依赖的package包/类
@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));
}