86
86
87
87
class InstantiatingGrpcChannelProviderTest extends AbstractMtlsTransportChannelTest {
88
88
private static final String DEFAULT_ENDPOINT = "test.googleapis.com:443" ;
89
- private static final String DEFAULT_MTLS_ENDPOINT = "test.mtls.googleapis.com:443" ;
90
89
private static final String API_KEY_HEADER_VALUE = "fake_api_key_2" ;
91
90
private static final String API_KEY_AUTH_HEADER_KEY = "x-goog-api-key" ;
92
91
private static String originalOSName ;
@@ -206,7 +205,7 @@ void testWithPoolSize() throws IOException {
206
205
executor .shutdown ();
207
206
EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
208
207
Mockito .when (endpointContext .useS2A ()).thenReturn (false );
209
- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
208
+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
210
209
TransportChannelProvider provider =
211
210
InstantiatingGrpcChannelProvider .newBuilder ()
212
211
.build ()
@@ -274,7 +273,7 @@ private void testWithInterceptors(int numChannels) throws Exception {
274
273
275
274
EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
276
275
Mockito .when (endpointContext .useS2A ()).thenReturn (false );
277
- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
276
+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
278
277
279
278
InstantiatingGrpcChannelProvider channelProvider =
280
279
InstantiatingGrpcChannelProvider .newBuilder ()
@@ -312,7 +311,7 @@ void testChannelConfigurator() throws IOException {
312
311
313
312
EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
314
313
Mockito .when (endpointContext .useS2A ()).thenReturn (false );
315
- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
314
+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
316
315
317
316
// Invoke the provider
318
317
InstantiatingGrpcChannelProvider .newBuilder ()
@@ -338,7 +337,7 @@ void testWithGCECredentials() throws IOException {
338
337
339
338
EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
340
339
Mockito .when (endpointContext .useS2A ()).thenReturn (false );
341
- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
340
+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
342
341
343
342
TransportChannelProvider provider =
344
343
InstantiatingGrpcChannelProvider .newBuilder ()
@@ -424,7 +423,7 @@ void testWithNonGCECredentials() throws IOException {
424
423
425
424
EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
426
425
Mockito .when (endpointContext .useS2A ()).thenReturn (false );
427
- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
426
+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
428
427
429
428
TransportChannelProvider provider =
430
429
InstantiatingGrpcChannelProvider .newBuilder ()
@@ -457,7 +456,7 @@ void testWithDirectPathDisabled() throws IOException {
457
456
458
457
EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
459
458
Mockito .when (endpointContext .useS2A ()).thenReturn (false );
460
- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
459
+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
461
460
462
461
TransportChannelProvider provider =
463
462
InstantiatingGrpcChannelProvider .newBuilder ()
@@ -490,7 +489,7 @@ void testWithNoDirectPathFlagSet() throws IOException {
490
489
491
490
EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
492
491
Mockito .when (endpointContext .useS2A ()).thenReturn (false );
493
- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
492
+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
494
493
495
494
TransportChannelProvider provider =
496
495
InstantiatingGrpcChannelProvider .newBuilder ()
@@ -515,7 +514,7 @@ void testWithIPv6Address() throws IOException {
515
514
<
10000
code>516 515
EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
517
516
Mockito .when (endpointContext .useS2A ()).thenReturn (false );
518
- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
517
+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
519
518
520
519
TransportChannelProvider provider =
521
520
InstantiatingGrpcChannelProvider .newBuilder ()
@@ -535,7 +534,7 @@ void testWithIPv6Address() throws IOException {
535
534
void testWithPrimeChannel () throws IOException {
536
535
EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
537
536
Mockito .when (endpointContext .useS2A ()).thenReturn (false );
538
- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
537
+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
539
538
// create channelProvider with different pool sizes to verify ChannelPrimer is called the
540
539
// correct number of times
541
540
for (int poolSize = 1 ; poolSize < 5 ; poolSize ++) {
@@ -669,7 +668,7 @@ private void createAndCloseTransportChannel(InstantiatingGrpcChannelProvider pro
669
668
InstantiatingGrpcChannelProvider .LOG .addHandler (logHandler );
670
669
EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
671
670
Mockito .when (endpointContext .useS2A ()).thenReturn (false );
672
- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
671
+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
673
672
InstantiatingGrpcChannelProvider provider =
674
673
createChannelProviderBuilderForDirectPathLogTests ()
675
674
.setAttemptDirectPathXds ()
@@ -717,7 +716,7 @@ void testLogDirectPathMisconfigWrongCredential() throws Exception {
717
716
InstantiatingGrpcChannelProvider .LOG .addHandler (logHandler );
718
717
EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
719
718
Mockito .when (endpointContext .useS2A ()).thenReturn (false );
720
- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
719
+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
721
720
InstantiatingGrpcChannelProvider provider =
722
721
InstantiatingGrpcChannelProvider .newBuilder ()
723
722
.setAttemptDirectPathXds ()
@@ -746,7 +745,7 @@ void testLogDirectPathMisconfigNotOnGCE() throws Exception {
746
745
InstantiatingGrpcChannelProvider .LOG .addHandler (logHandler );
747
746
EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
748
747
Mockito .when (endpointContext .useS2A ()).thenReturn (false );
749
- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
748
+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
750
749
InstantiatingGrpcChannelProvider provider =
751
750
InstantiatingGrpcChannelProvider .newBuilder ()
752
751
.setAttemptDirectPathXds ()
@@ -780,7 +779,7 @@ public void canUseDirectPath_happyPath() throws IOException {
780
779
InstantiatingGrpcChannelProvider .DIRECT_PATH_ENV_DISABLE_DIRECT_PATH ))
781
780
.thenReturn ("false" );
782
781
EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
783
- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
782
+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
784
783
InstantiatingGrpcChannelProvider .Builder builder =
785
784
InstantiatingGrpcChannelProvider .newBuilder ()
786
785
.setAttemptDirectPath (true )
@@ -809,7 +808,7 @@ public void canUseDirectPath_directPathEnvVarDisabled() throws IOException {
809
808
.thenReturn ("true" );
810
809
EndpointContext endpointContext = Mockito .mock (EndpointContext .class );
811
810
Mockito .when (endpointContext .useS2A ()).thenReturn (false );
812
- Mockito .when (endpointContext .mtlsEndpoint ()).thenReturn (DEFAULT_MTLS_ENDPOINT );
811
+ Mockito .when (endpointContext .resolvedEndpoint ()).thenReturn (DEFAULT_ENDPOINT );
813
812
InstantiatingGrpcChannelProvider .Builder builder =
814
813
InstantiatingGrpcChannelProvider .newBuilder ()
815
814
.setAttemptDirectPath (true )
0 commit comments