List of usage examples for org.springframework.data.web WebTestUtils createApplicationContext
public static WebApplicationContext createApplicationContext(ClassLoader classLoader, Class<?>... configClasses)
From source file:org.springframework.data.web.config.EnableSpringDataWebSupportIntegrationTests.java
@Test // DATACMNS-330 public void doesNotRegisterHateoasSpecificComponentsIfHateoasNotPresent() throws Exception { HidingClassLoader classLoader = HidingClassLoader.hide(Link.class); ApplicationContext context = WebTestUtils.createApplicationContext(classLoader, SampleConfig.class); List<String> names = Arrays.asList(context.getBeanDefinitionNames()); assertThat(names).contains("pageableResolver", "sortResolver"); assertThat(names).doesNotContain("pagedResourcesAssembler", "pagedResourcesAssemblerArgumentResolver"); }
From source file:org.springframework.data.web.config.EnableSpringDataWebSupportIntegrationTests.java
@Test // DATACMNS-475 public void doesNotRegisterJacksonSpecificComponentsIfJacksonNotPresent() throws Exception { ApplicationContext context = WebTestUtils .createApplicationContext(HidingClassLoader.hide(ObjectMapper.class), SampleConfig.class); List<String> names = Arrays.asList(context.getBeanDefinitionNames()); assertThat(names).doesNotContain("jacksonGeoModule"); }