8686
8787class InstantiatingGrpcChannelProviderTest extends AbstractMtlsTransportChannelTest {
8888 private static final String DEFAULT_ENDPOINT = "test.googleapis.com:443" ;
89- private static final String DEFAULT_MTLS_ENDPOINT = "test.mtls.googleapis.com:443" ;
9089 private static final String API_KEY_HEADER_VALUE = "fake_api_key_2" ;
9190 private static final String API_KEY_AUTH_HEADER_KEY = "x-goog-api-key" ;
9291 private static String originalOSName ;
@@ -206,7 +205,7 @@ void testWithPoolSize() throws IOException {
206205 executor .shutdown ();
207206 EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
208207 Mockito .when (endpointContext .useS2A ()).thenReturn (false );
209- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
208+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
210209 TransportChannelProvider provider =
211210 InstantiatingGrpcChannelProvider .newBuilder ()
212211 .build ()
@@ -274,7 +273,7 @@ private void testWithInterceptors(int numChannels) throws Exception {
274273
275274 EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
276275 Mockito .when (endpointContext .useS2A ()).thenReturn (false );
277- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
276+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
278277
279278 InstantiatingGrpcChannelProvider channelProvider =
280279 InstantiatingGrpcChannelProvider .newBuilder ()
@@ -312,7 +311,7 @@ void testChannelConfigurator() throws IOException {
312311
313312 EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
314313 Mockito .when (endpointContext .useS2A ()).thenReturn (false );
315- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
314+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
316315
317316 // Invoke the provider
318317 InstantiatingGrpcChannelProvider .newBuilder ()
@@ -338,7 +337,7 @@ void testWithGCECredentials() throws IOException {
338337
339338 EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
340339 Mockito .when (endpointContext .useS2A ()).thenReturn (false );
341- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
340+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
342341
343342 TransportChannelProvider provider =
344343 InstantiatingGrpcChannelProvider .newBuilder ()
@@ -424,7 +423,7 @@ void testWithNonGCECredentials() throws IOException {
424423
425424 EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
426425 Mockito .when (endpointContext .useS2A ()).thenReturn (false );
427- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
426+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
428427
429428 TransportChannelProvider provider =
430429 InstantiatingGrpcChannelProvider .newBuilder ()
@@ -457,7 +456,7 @@ void testWithDirectPathDisabled() throws IOException {
457456
458457 EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
459458 Mockito .when (endpointContext .useS2A ()).thenReturn (false );
460- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
459+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
461460
462461 TransportChannelProvider provider =
463462 InstantiatingGrpcChannelProvider .newBuilder ()
@@ -490,7 +489,7 @@ void testWithNoDirectPathFlagSet() throws IOException {
490489
491490 EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
492491 Mockito .when (endpointContext .useS2A ()).thenReturn (false );
493- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
492+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
494493
495494 TransportChannelProvider provider =
496495 InstantiatingGrpcChannelProvider .newBuilder ()
@@ -515,7 +514,7 @@ void testWithIPv6Address() throws IOException {
515514
516515 EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
517516 Mockito .when (endpointContext .useS2A ()).thenReturn (false );
518- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
517+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
519518
520519 TransportChannelProvider provider =
521520 InstantiatingGrpcChannelProvider .newBuilder ()
@@ -535,7 +534,7 @@ void testWithIPv6Address() throws IOException {
535534 void testWithPrimeChannel () throws IOException {
536535 EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
537536 Mockito .when (endpointContext .useS2A ()).thenReturn (false );
538- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
537+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
539538 // create channelProvider with different pool sizes to verify ChannelPrimer is called the
540539 // correct number of times
541540 for (int poolSize = 1 ; poolSize < 5 ; poolSize ++) {
@@ -669,7 +668,7 @@ private void createAndCloseTransportChannel(InstantiatingGrpcChannelProvider pro
669668 InstantiatingGrpcChannelProvider .LOG .addHandler (logHandler );
670669 EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
671670 Mockito .when (endpointContext .useS2A ()).thenReturn (false );
672- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
671+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
673672 InstantiatingGrpcChannelProvider provider =
674673 createChannelProviderBuilderForDirectPathLogTests ()
675674 .setAttemptDirectPathXds ()
@@ -717,7 +716,7 @@ void testLogDirectPathMisconfigWrongCredential() throws Exception {
717716 InstantiatingGrpcChannelProvider .LOG .addHandler (logHandler );
718717 EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
719718 Mockito .when (endpointContext .useS2A ()).thenReturn (false );
720- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
719+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
721720 InstantiatingGrpcChannelProvider provider =
722721 InstantiatingGrpcChannelProvider .newBuilder ()
723722 .setAttemptDirectPathXds ()
@@ -746,7 +745,7 @@ void testLogDirectPathMisconfigNotOnGCE() throws Exception {
746745 InstantiatingGrpcChannelProvider .LOG .addHandler (logHandler );
747746 EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
748747 Mockito .when (endpointContext .useS2A ()).thenReturn (false );
749- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
748+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
750749 InstantiatingGrpcChannelProvider provider =
751750 InstantiatingGrpcChannelProvider .newBuilder ()
752751 .setAttemptDirectPathXds ()
@@ -780,7 +779,7 @@ public void canUseDirectPath_happyPath() throws IOException {
780779 InstantiatingGrpcChannelProvider .DIRECT_PATH_ENV_DISABLE_DIRECT_PATH ))
781780 .thenReturn ("false" );
782781 EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
783- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
782+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
784783 InstantiatingGrpcChannelProvider .Builder builder =
785784 InstantiatingGrpcChannelProvider .newBuilder ()
786785 .setAttemptDirectPath (true )
@@ -809,7 +808,7 @@ public void canUseDirectPath_directPathEnvVarDisabled() throws IOException {
809808 .thenReturn ("true" );
810809 EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
811810 Mockito .when (endpointContext .useS2A ()).thenReturn (false );
812- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
811+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
813812 InstantiatingGrpcChannelProvider .Builder builder =
814813 InstantiatingGrpcChannelProvider .newBuilder ()
815814 .setAttemptDirectPath (true )
0 commit comments