use of org.springframework.data.web.PageableHandlerMethodArgumentResolver in project spring-boot by spring-projects.
the class SpringDataWebAutoConfigurationTests method webSupportIsAutoConfiguredInWebApplicationContexts.
@Test
public void webSupportIsAutoConfiguredInWebApplicationContexts() {
this.context = new AnnotationConfigWebApplicationContext();
((AnnotationConfigWebApplicationContext) this.context).register(SpringDataWebAutoConfiguration.class);
this.context.refresh();
((AnnotationConfigWebApplicationContext) this.context).setServletContext(new MockServletContext());
Map<String, PageableHandlerMethodArgumentResolver> beans = this.context.getBeansOfType(PageableHandlerMethodArgumentResolver.class);
assertThat(beans).hasSize(1);
}
use of org.springframework.data.web.PageableHandlerMethodArgumentResolver in project spring-boot by spring-projects.
the class SpringDataWebAutoConfigurationTests method autoConfigurationBacksOffInNonWebApplicationContexts.
@Test
public void autoConfigurationBacksOffInNonWebApplicationContexts() {
this.context = new AnnotationConfigApplicationContext();
((AnnotationConfigApplicationContext) this.context).register(SpringDataWebAutoConfiguration.class);
this.context.refresh();
Map<String, PageableHandlerMethodArgumentResolver> beans = this.context.getBeansOfType(PageableHandlerMethodArgumentResolver.class);
assertThat(beans).isEmpty();
}
Aggregations