Skip to content

Commit 6d7e298

Browse files
committed
dirty
1 parent ab24227 commit 6d7e298

File tree

1 file changed

+8
-5
lines changed
  • spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery/src/test/java/org/springframework/cloud/kubernetes/fabric8/client/discovery/it

1 file changed

+8
-5
lines changed

spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery/src/test/java/org/springframework/cloud/kubernetes/fabric8/client/discovery/it/TestAssertions.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,20 @@ static void assertPodMetadata(DiscoveryClient discoveryClient) {
3838

3939
List<ServiceInstance> serviceInstances = discoveryClient.getInstances("busybox-service");
4040

41+
// if annotations are empty, we got the other pod, with labels here
4142
DefaultKubernetesServiceInstance withCustomLabel = serviceInstances.stream()
4243
.map(instance -> (DefaultKubernetesServiceInstance) instance)
4344
.filter(x -> x.podMetadata().getOrDefault("annotations", Map.of()).isEmpty())
4445
.toList()
4546
.get(0);
4647

47-
Assertions.assertEquals(withCustomLabel.getServiceId(), "busybox-service");
48-
Assertions.assertNotNull(withCustomLabel.getInstanceId());
49-
Assertions.assertNotNull(withCustomLabel.getHost());
50-
Assertions.assertEquals(withCustomLabel.getMetadata(),
51-
Map.of("k8s_namespace", "default", "type", "ClusterIP", "port.busybox-port", "80"));
48+
assertThat(withCustomLabel.getServiceId()).isEqualTo("busybox-service");
49+
assertThat(withCustomLabel.getInstanceId()).isNotNull();
50+
assertThat(withCustomLabel.getHost()).isNotNull();
51+
assertThat(withCustomLabel.getMetadata()).isEqualTo(
52+
Map.of("k8s_namespace", "default", "type", "ClusterIP", "port.busybox-port", "80")
53+
);
54+
5255
Assertions.assertTrue(withCustomLabel.podMetadata()
5356
.get("labels")
5457
.entrySet()

0 commit comments

Comments
 (0)