38
38
import io .kubernetes .client .openapi .models .V1ServiceSpecBuilder ;
39
39
import org .junit .jupiter .api .BeforeEach ;
40
40
import org .junit .jupiter .api .Test ;
41
-
42
41
import org .mockito .Mockito ;
42
+
43
43
import org .springframework .cloud .client .ServiceInstance ;
44
44
import org .springframework .cloud .kubernetes .commons .discovery .KubernetesDiscoveryProperties ;
45
45
import org .springframework .cloud .kubernetes .commons .discovery .KubernetesServiceInstance ;
@@ -97,8 +97,8 @@ void getInstancesShouldBeAbleToHandleEndpointsSingleAddress() {
97
97
false , null , Set .of (), Map .of (), null , metadata , 0 , true );
98
98
99
99
KubernetesInformerDiscoveryClient discoveryClient = new KubernetesInformerDiscoveryClient (List .of (STUB ),
100
- List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
101
- List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , null );
100
+ List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
101
+ List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , null );
102
102
103
103
List <ServiceInstance > instances = discoveryClient .getInstances ("id" );
104
104
@@ -128,8 +128,8 @@ void getInstancesShouldBeAbleToHandleEndpointsSingleAddressAndMultiplePorts() {
128
128
false , null , Set .of (), labels , "http_tcp" , KubernetesDiscoveryProperties .Metadata .DEFAULT , 0 , true );
129
129
130
130
KubernetesInformerDiscoveryClient discoveryClient = new KubernetesInformerDiscoveryClient (List .of (STUB ),
131
- List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
132
- List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
131
+ List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
132
+ List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
133
133
134
134
List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint" );
135
135
@@ -163,8 +163,8 @@ void getInstancesShouldBeAbleToHandleEndpointsMultipleAddresses() {
163
163
false , null , Set .of (443 , 8443 ), labels , null , metadata , 0 , true );
164
164
165
165
KubernetesInformerDiscoveryClient discoveryClient = new KubernetesInformerDiscoveryClient (List .of (STUB ),
166
- List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
167
- List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
166
+ List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
167
+ List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
168
168
169
169
List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint" );
170
170
@@ -200,8 +200,8 @@ void getInstancesShouldBeAbleToHandleEndpointsFromMultipleNamespaces() {
200
200
false , null , Set .of (), Map .of (), null , KubernetesDiscoveryProperties .Metadata .DEFAULT , 0 , true );
201
201
202
202
KubernetesInformerDiscoveryClient discoveryClient = new KubernetesInformerDiscoveryClient (List .of (STUB ),
203
- List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
204
- List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
203
+ List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
204
+ List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
205
205
206
206
List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint" );
207
207
@@ -240,8 +240,8 @@ void instanceWithoutSubsetsShouldBeSkipped() {
240
240
KubernetesDiscoveryProperties properties = new KubernetesDiscoveryProperties (true , true , Set .of (), true , 60 ,
241
241
false , null , Set .of (), Map .of (), null , KubernetesDiscoveryProperties .Metadata .DEFAULT , 0 , true );
242
242
KubernetesInformerDiscoveryClient discoveryClient = new KubernetesInformerDiscoveryClient (List .of (STUB ),
243
- List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
244
- List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
243
+ List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
244
+ List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
245
245
246
246
List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint1" );
247
247
@@ -267,8 +267,8 @@ void getInstancesShouldBeAbleToHandleEndpointsSingleAddressAndMultiplePortsUsing
267
267
false , null , Set .of (443 , 8443 ), Map .of (), null , KubernetesDiscoveryProperties .Metadata .DEFAULT , 0 ,
268
268
true );
269
269
KubernetesInformerDiscoveryClient discoveryClient = new KubernetesInformerDiscoveryClient (List .of (STUB ),
270
- List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
271
- List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
270
+ List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
271
+ List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
272
272
273
273
List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint2" );
274
274
@@ -300,8 +300,8 @@ void instanceWithMultiplePortsAndMisconfiguredPrimaryPortNameInLabelWithoutFallb
300
300
false , null , Set .of (443 , 8443 ), Map .of (), null , KubernetesDiscoveryProperties .Metadata .DEFAULT , 0 ,
301
301
true );
302
302
KubernetesInformerDiscoveryClient discoveryClient = new KubernetesInformerDiscoveryClient (List .of (STUB ),
303
- List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
304
- List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
303
+ List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
304
+ List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
305
305
306
306
List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint3" );
307
307
@@ -332,8 +332,8 @@ void instanceWithMultiplePortsAndMisconfiguredGenericPrimaryPortNameWithoutFallb
332
332
false , null , Set .of (443 , 8443 ), Map .of (), "oops" , KubernetesDiscoveryProperties .Metadata .DEFAULT , 0 ,
333
333
true );
334
334
KubernetesInformerDiscoveryClient discoveryClient = new KubernetesInformerDiscoveryClient (List .of (STUB ),
335
- List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
336
- List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
335
+ List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
336
+ List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
337
337
338
338
List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint4" );
339
339
@@ -365,8 +365,8 @@ void instanceWithMultiplePortsAndWithoutPrimaryPortNameSpecifiedShouldFallBackTo
365
365
true );
366
366
367
367
KubernetesInformerDiscoveryClient discoveryClient = new KubernetesInformerDiscoveryClient (List .of (STUB ),
368
- List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
369
- List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
368
+ List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
369
+ List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
370
370
371
371
List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint5" );
372
372
@@ -395,8 +395,8 @@ void instanceWithMultiplePortsAndWithoutPrimaryPortNameSpecifiedOrHttpsPortShoul
395
395
setup (serviceId , serviceType , namespace , labels , ips , uuids , names , protocols , ports , appProtocols );
396
396
397
397
KubernetesInformerDiscoveryClient discoveryClient = new KubernetesInformerDiscoveryClient (List .of (STUB ),
398
- List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
399
- List .of (ENDPOINTS_SHARED_INFORMER_STUB ), KubernetesDiscoveryProperties .DEFAULT , CORE_V1_API );
398
+ List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
399
+ List .of (ENDPOINTS_SHARED_INFORMER_STUB ), KubernetesDiscoveryProperties .DEFAULT , CORE_V1_API );
400
400
401
401
List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint5" );
402
402
@@ -428,8 +428,8 @@ void instanceWithMultiplePortsAndWithoutPrimaryPortNameSpecifiedShouldLogWarning
428
428
true , null , Set .of (443 , 8443 ), Map .of (), null , KubernetesDiscoveryProperties .Metadata .DEFAULT , 0 , true );
429
429
430
430
KubernetesInformerDiscoveryClient discoveryClient = new KubernetesInformerDiscoveryClient (List .of (STUB ),
431
- List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
432
- List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
431
+ List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
432
+ List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
433
433
434
434
List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint5" );
435
435
@@ -461,8 +461,8 @@ public void instanceWithoutPorts() {
461
461
KubernetesDiscoveryProperties properties = KubernetesDiscoveryProperties .DEFAULT ;
462
462
463
463
KubernetesInformerDiscoveryClient discoveryClient = new KubernetesInformerDiscoveryClient (List .of (STUB ),
464
- List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
465
- List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
464
+ List .of (servicesLister ), List .of (endpointsLister ), List .of (SERVICE_SHARED_INFORMER_STUB ),
465
+ List .of (ENDPOINTS_SHARED_INFORMER_STUB ), properties , CORE_V1_API );
466
466
467
467
List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint5" );
468
468
0 commit comments