File tree 2 files changed +29
-4
lines changed
gax-java/gax/src/main/java/com/google/api/gax/rpc/internal
showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it
2 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -90,8 +90,8 @@ public void refresh() throws IOException {
90
90
this .wrappedCredentials .refresh ();
91
91
}
92
92
93
- @ Override
94
- public String getUniverseDomain () throws IOException {
95
- return this .wrappedCredentials .getUniverseDomain ();
96
- }
93
+ // @Override
94
+ // public String getUniverseDomain() throws IOException {
95
+ // return this.wrappedCredentials.getUniverseDomain();
96
+ // }
97
97
}
Original file line number Diff line number Diff line change @@ -444,4 +444,29 @@ void endpointResolution_builderBuilderBackToBuilder() throws IOException {
444
444
echoStubSettingsBuilder = echoStubSettings .toBuilder ();
445
445
Truth .assertThat (echoStubSettingsBuilder .getEndpoint ()).isEqualTo (customEndpoint );
446
446
}
447
+
448
+ @ Test
449
+ void universeDomainValidation_quotaProjectId_credentialsNonGDUMatchesUserConfiguration ()
450
+ throws IOException {
451
+ String universeDomain = "random.com" ;
452
+ EchoSettings echoSettings =
453
+ ExtendedEchoSettings .newBuilder ()
454
+ .setQuotaProjectId ("exampleProject" )
455
+ .setCredentialsProvider (UniverseDomainCredentialsProvider .create (universeDomain ))
456
+ .setEndpoint (TestClientInitializer .DEFAULT_GRPC_ENDPOINT )
457
+ .setUniverseDomain (universeDomain )
458
+ .setTransportChannelProvider (
459
+ EchoSettings .defaultGrpcTransportProviderBuilder ()
460
+ .setChannelConfigurator (ManagedChannelBuilder ::usePlaintext )
461
+ .build ())
462
+ .build ();
463
+ echoClient = EchoClient .create (echoSettings );
464
+
465
+ UnauthenticatedException exception =
466
+ assertThrows (UnauthenticatedException .class , () -> echoClient .echo (DEFAULT_REQUEST ));
467
+ Truth .assertThat (exception .getMessage ())
468
+ .contains (
469
+ "The configured universe domain (random.com) does not match the universe domain found in the credentials (googleapis.com)." );
470
+ // Truth.assertThat(echoClient.echo(DEFAULT_REQUEST).getContent()).isEqualTo("echo");
471
+ }
447
472
}
You can’t perform that action at this time.
0 commit comments