Skip to content

Commit

Permalink
Remove Jetty/Netty/ApacheHttpClient checks for WebClient
Browse files Browse the repository at this point in the history
  • Loading branch information
anugrahsinghal authored and mhalbritter committed Jan 9, 2023
1 parent f11de0c commit 3191c67
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,14 @@
*
* @author Stephane Nicoll
* @author Andy Wilkinson
* @author Anugrah Singhal
*/
class WebTestClientContextCustomizerFactory implements ContextCustomizerFactory {

private static final boolean reactorClientPresent;

private static final boolean jettyClientPresent;

private static final boolean httpComponentsClientPresent;

private static final boolean webClientPresent;

static {
ClassLoader loader = WebTestClientContextCustomizerFactory.class.getClassLoader();
reactorClientPresent = ClassUtils.isPresent("reactor.netty.http.client.HttpClient", loader);
jettyClientPresent = ClassUtils.isPresent("org.eclipse.jetty.client.HttpClient", loader);
httpComponentsClientPresent = ClassUtils
.isPresent("org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient", loader)
&& ClassUtils.isPresent("org.apache.hc.core5.reactive.ReactiveDataConsumer", loader);
webClientPresent = ClassUtils.isPresent("org.springframework.web.reactive.function.client.WebClient", loader);
}

Expand All @@ -56,9 +46,7 @@ public ContextCustomizer createContextCustomizer(Class<?> testClass,
List<ContextConfigurationAttributes> configAttributes) {
SpringBootTest springBootTest = TestContextAnnotationUtils.findMergedAnnotation(testClass,
SpringBootTest.class);
return (springBootTest != null && webClientPresent
&& (reactorClientPresent || jettyClientPresent || httpComponentsClientPresent))
? new WebTestClientContextCustomizer() : null;
return (springBootTest != null && webClientPresent) ? new WebTestClientContextCustomizer() : null;
}

}

This file was deleted.

0 comments on commit 3191c67

Please sign in to comment.