From 9263f1d67bf7bcfc39e44f8a767c4604cddd99da Mon Sep 17 00:00:00 2001 From: Ioannis Canellos Date: Tue, 30 Jun 2020 16:52:54 +0300 Subject: [PATCH] test (#10620): labels on ingress and routes --- .../KubernetesWithApplicationPropertiesTest.java | 5 +++++ .../OpenshiftWithApplicationPropertiesTest.java | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithApplicationPropertiesTest.java b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithApplicationPropertiesTest.java index 81dae05cb9f5ea..4bbb2764c949ab 100644 --- a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithApplicationPropertiesTest.java +++ b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithApplicationPropertiesTest.java @@ -96,6 +96,11 @@ public void assertGeneratedResources() throws IOException { assertThat(kubernetesList).filteredOn(i -> "Ingress".equals(i.getKind())).hasOnlyOneElementSatisfying(i -> { assertThat(i).isInstanceOfSatisfying(Ingress.class, in -> { + //Check that lables are also applied to Ingresses (#10260) + assertThat(i.getMetadata()).satisfies(m -> { + assertThat(m.getName()).isEqualTo("test-it"); + assertThat(m.getLabels()).contains(entry("foo", "bar")); + }); assertThat(in.getSpec().getRules()).hasOnlyOneElementSatisfying(r -> { assertThat(r.getHost()).isEqualTo("example.com"); }); diff --git a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/OpenshiftWithApplicationPropertiesTest.java b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/OpenshiftWithApplicationPropertiesTest.java index ebd8cf95572497..c82f515d469d0a 100644 --- a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/OpenshiftWithApplicationPropertiesTest.java +++ b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/OpenshiftWithApplicationPropertiesTest.java @@ -16,6 +16,7 @@ import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.PodSpec; import io.fabric8.kubernetes.api.model.Service; +import io.fabric8.openshift.api.model.Route; import io.quarkus.test.ProdBuildResults; import io.quarkus.test.ProdModeTestResults; import io.quarkus.test.QuarkusProdModeTest; @@ -66,6 +67,14 @@ public void assertGeneratedResources() throws IOException { }); }); - assertThat(openshiftList).filteredOn(h -> "Route".equals(h.getKind())).hasSize(1); + assertThat(openshiftList).filteredOn(i -> "Route".equals(i.getKind())).hasOnlyOneElementSatisfying(i -> { + assertThat(i).isInstanceOfSatisfying(Route.class, in -> { + //Check that lables are also applied to Routes (#10260) + assertThat(i.getMetadata()).satisfies(m -> { + assertThat(m.getName()).isEqualTo("test-it"); + assertThat(m.getLabels()).contains(entry("foo", "bar")); + }); + }); + }); } }