@Test void cacheConfigurationConditionalOnClass() { this.contextRunner .withClassLoader(new FilteredClassLoader("javax.cache.CacheManager")) .run((context) -> assertThat(context) .doesNotHaveBean(JCacheManagerCustomizer.class)); }
@Test public void testDisabledByMissingEntityManagerClass() { this.webApplicationContextRunner .withClassLoader(new FilteredClassLoader(EntityManager.class)) .run(context -> { assertThat(context).doesNotHaveBean(OpenEntityManagerInViewInterceptor.class); assertThat(context).doesNotHaveBean(OpenEntityManagerInViewFilter.class); }); } }
@Test public void shouldNotConfigureIfHttpClientIsMissing() { contextRunner .withUserConfiguration(AuthenticationFactoryConfiguration.class) .withClassLoader( new FilteredClassLoader("reactor.netty.http.client.HttpClient")) .run(context -> { assertThat(context.getBeanNamesForType(ReactiveVaultOperations.class)) .isEmpty(); }); }