3838import io .kubernetes .client .openapi .models .V1ServiceSpecBuilder ;
3939import org .junit .jupiter .api .BeforeEach ;
4040import org .junit .jupiter .api .Test ;
41-
4241import org .mockito .Mockito ;
42+
4343import org .springframework .cloud .client .ServiceInstance ;
4444import org .springframework .cloud .kubernetes .commons .discovery .KubernetesDiscoveryProperties ;
4545import org .springframework .cloud .kubernetes .commons .discovery .KubernetesServiceInstance ;
@@ -97,8 +97,8 @@ void getInstancesShouldBeAbleToHandleEndpointsSingleAddress() {
9797 false , null , Set .of (), Map .of (), null , metadata , 0 , true );
9898
9999 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 );
102102
103103 List <ServiceInstance > instances = discoveryClient .getInstances ("id" );
104104
@@ -128,8 +128,8 @@ void getInstancesShouldBeAbleToHandleEndpointsSingleAddressAndMultiplePorts() {
128128 false , null , Set .of (), labels , "http_tcp" , KubernetesDiscoveryProperties .Metadata .DEFAULT , 0 , true );
129129
130130 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 );
133133
134134 List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint" );
135135
@@ -163,8 +163,8 @@ void getInstancesShouldBeAbleToHandleEndpointsMultipleAddresses() {
163163 false , null , Set .of (443 , 8443 ), labels , null , metadata , 0 , true );
164164
165165 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 );
168168
169169 List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint" );
170170
@@ -200,8 +200,8 @@ void getInstancesShouldBeAbleToHandleEndpointsFromMultipleNamespaces() {
200200 false , null , Set .of (), Map .of (), null , KubernetesDiscoveryProperties .Metadata .DEFAULT , 0 , true );
201201
202202 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 );
205205
206206 List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint" );
207207
@@ -240,8 +240,8 @@ void instanceWithoutSubsetsShouldBeSkipped() {
240240 KubernetesDiscoveryProperties properties = new KubernetesDiscoveryProperties (true , true , Set .of (), true , 60 ,
241241 false , null , Set .of (), Map .of (), null , KubernetesDiscoveryProperties .Metadata .DEFAULT , 0 , true );
242242 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 );
245245
246246 List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint1" );
247247
@@ -267,8 +267,8 @@ void getInstancesShouldBeAbleToHandleEndpointsSingleAddressAndMultiplePortsUsing
267267 false , null , Set .of (443 , 8443 ), Map .of (), null , KubernetesDiscoveryProperties .Metadata .DEFAULT , 0 ,
268268 true );
269269 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 );
272272
273273 List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint2" );
274274
@@ -300,8 +300,8 @@ void instanceWithMultiplePortsAndMisconfiguredPrimaryPortNameInLabelWithoutFallb
300300 false , null , Set .of (443 , 8443 ), Map .of (), null , KubernetesDiscoveryProperties .Metadata .DEFAULT , 0 ,
301301 true );
302302 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 );
305305
306306 List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint3" );
307307
@@ -332,8 +332,8 @@ void instanceWithMultiplePortsAndMisconfiguredGenericPrimaryPortNameWithoutFallb
332332 false , null , Set .of (443 , 8443 ), Map .of (), "oops" , KubernetesDiscoveryProperties .Metadata .DEFAULT , 0 ,
333333 true );
334334 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 );
337337
338338 List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint4" );
339339
@@ -365,8 +365,8 @@ void instanceWithMultiplePortsAndWithoutPrimaryPortNameSpecifiedShouldFallBackTo
365365 true );
366366
367367 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 );
370370
371371 List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint5" );
372372
@@ -395,8 +395,8 @@ void instanceWithMultiplePortsAndWithoutPrimaryPortNameSpecifiedOrHttpsPortShoul
395395 setup (serviceId , serviceType , namespace , labels , ips , uuids , names , protocols , ports , appProtocols );
396396
397397 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 );
400400
401401 List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint5" );
402402
@@ -428,8 +428,8 @@ void instanceWithMultiplePortsAndWithoutPrimaryPortNameSpecifiedShouldLogWarning
428428 true , null , Set .of (443 , 8443 ), Map .of (), null , KubernetesDiscoveryProperties .Metadata .DEFAULT , 0 , true );
429429
430430 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 );
433433
434434 List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint5" );
435435
@@ -461,8 +461,8 @@ public void instanceWithoutPorts() {
461461 KubernetesDiscoveryProperties properties = KubernetesDiscoveryProperties .DEFAULT ;
462462
463463 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 );
466466
467467 List <ServiceInstance > instances = discoveryClient .getInstances ("endpoint5" );
468468
0 commit comments