This repository was archived by the owner on Sep 26, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
main/java/com/google/api/gax/httpjson
test/java/com/google/api/gax/httpjson Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ public static class Builder {
153
153
private Builder () {}
154
154
155
155
public Builder setExecutor (Executor executor ) {
156
- this .executor = Preconditions . checkNotNull ( executor ) ;
156
+ this .executor = executor == null ? DEFAULT_EXECUTOR : executor ;
157
157
return this ;
158
158
}
159
159
Original file line number Diff line number Diff line change @@ -62,6 +62,13 @@ public void basicTest() throws IOException {
62
62
provider = provider .withEndpoint (endpoint );
63
63
assertThat (provider .needsEndpoint ()).isFalse ();
64
64
65
+ assertThat (provider .needsHeaders ()).isTrue ();
66
+ provider = provider .withHeaders (Collections .<String , String >emptyMap ());
67
+ assertThat (provider .needsHeaders ()).isFalse ();
68
+
69
+ // Make sure getTransportChannel works without setting executor
70
+ assertThat (provider .getTransportChannel ()).isInstanceOf (HttpJsonTransportChannel .class );
71
+
65
72
assertThat (provider .needsExecutor ()).isTrue ();
66
73
provider = provider .withExecutor ((Executor ) executor );
67
74
assertThat (provider .needsExecutor ()).isFalse ();
@@ -71,10 +78,6 @@ public void basicTest() throws IOException {
71
78
provider = provider .withExecutor (executor );
72
79
assertThat (provider .needsExecutor ()).isFalse ();
73
80
74
- assertThat (provider .needsHeaders ()).isTrue ();
75
- provider = provider .withHeaders (Collections .<String , String >emptyMap ());
76
- assertThat (provider .needsHeaders ()).isFalse ();
77
-
78
81
assertThat (provider .acceptsPoolSize ()).isFalse ();
79
82
Exception thrownException = null ;
80
83
try {
You can’t perform that action at this time.
0 commit comments