Skip to content

Commit

Permalink
Merge pull request #23996 from chonton/23949
Browse files Browse the repository at this point in the history
Prevent NPE in Reactive Client when registering on ClientBuilder due to no Configuration
  • Loading branch information
gsmet authored Feb 28, 2022
2 parents 2261afc + b520c71 commit 9b4eab6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ public class AsyncRestClientFilterTestCase {

@BeforeEach
public void before() {
client = ClientBuilder.newClient()
// register one filter with builder to test configuration inheritance
client = ClientBuilder.newBuilder()
.register(SyncClientRequestFilter.class)
.build()
.register(AsyncClientRequestFilter.class)
.register(AsyncClientResponseFilter.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.regex.Pattern;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.ws.rs.RuntimeType;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.core.Configuration;
import org.jboss.logging.Logger;
Expand Down Expand Up @@ -62,6 +63,10 @@ public class ClientBuilderImpl extends ClientBuilder {
private ClientLogger clientLogger = new DefaultClientLogger();
private String userAgent = "Resteasy Reactive Client";

public ClientBuilderImpl() {
configuration = new ConfigurationImpl(RuntimeType.CLIENT);
}

@Override
public ClientBuilder withConfig(Configuration config) {
this.configuration = new ConfigurationImpl(config);
Expand Down

0 comments on commit 9b4eab6

Please sign in to comment.