This repository was archived by the owner on Sep 26, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
main/java/com/google/api/gax/httpjson
test/java/com/google/api/gax/httpjson Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ public static class Builder {
153153 private Builder () {}
154154
155155 public Builder setExecutor (Executor executor ) {
156- this .executor = Preconditions . checkNotNull ( executor ) ;
156+ this .executor = executor == null ? DEFAULT_EXECUTOR : executor ;
157157 return this ;
158158 }
159159
Original file line number Diff line number Diff line change @@ -62,6 +62,13 @@ public void basicTest() throws IOException {
6262 provider = provider .withEndpoint (endpoint );
6363 assertThat (provider .needsEndpoint ()).isFalse ();
6464
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+
6572 assertThat (provider .needsExecutor ()).isTrue ();
6673 provider = provider .withExecutor ((Executor ) executor );
6774 assertThat (provider .needsExecutor ()).isFalse ();
@@ -71,10 +78,6 @@ public void basicTest() throws IOException {
7178 provider = provider .withExecutor (executor );
7279 assertThat (provider .needsExecutor ()).isFalse ();
7380
74- assertThat (provider .needsHeaders ()).isTrue ();
75- provider = provider .withHeaders (Collections .<String , String >emptyMap ());
76- assertThat (provider .needsHeaders ()).isFalse ();
77-
7881 assertThat (provider .acceptsPoolSize ()).isFalse ();
7982 Exception thrownException = null ;
8083 try {
You can’t perform that action at this time.
0 commit comments