Skip to content
Permalink
Browse files
fix: fix httpjson executor (#1448)
  • Loading branch information
mutianf committed Aug 9, 2021
1 parent 209b494 commit 8f48b7027b95e8e75872d1f9dac537ea697d0acc
@@ -153,7 +153,7 @@ public static class Builder {
private Builder() {}

public Builder setExecutor(Executor executor) {
this.executor = Preconditions.checkNotNull(executor);
this.executor = executor == null ? DEFAULT_EXECUTOR : executor;
return this;
}

@@ -62,6 +62,13 @@ public void basicTest() throws IOException {
provider = provider.withEndpoint(endpoint);
assertThat(provider.needsEndpoint()).isFalse();

assertThat(provider.needsHeaders()).isTrue();
provider = provider.withHeaders(Collections.<String, String>emptyMap());
assertThat(provider.needsHeaders()).isFalse();

// Make sure getTransportChannel works without setting executor
assertThat(provider.getTransportChannel()).isInstanceOf(HttpJsonTransportChannel.class);

assertThat(provider.needsExecutor()).isTrue();
provider = provider.withExecutor((Executor) executor);
assertThat(provider.needsExecutor()).isFalse();
@@ -71,10 +78,6 @@ public void basicTest() throws IOException {
provider = provider.withExecutor(executor);
assertThat(provider.needsExecutor()).isFalse();

assertThat(provider.needsHeaders()).isTrue();
provider = provider.withHeaders(Collections.<String, String>emptyMap());
assertThat(provider.needsHeaders()).isFalse();

assertThat(provider.acceptsPoolSize()).isFalse();
Exception thrownException = null;
try {

0 comments on commit 8f48b70

Please sign in to comment.