Skip to content

Commit

Permalink
test (#10620): labels on ingress and routes
Browse files Browse the repository at this point in the history
  • Loading branch information
iocanel committed Jun 30, 2020
1 parent f4af52f commit 9263f1d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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"));
});
});
});
}
}

0 comments on commit 9263f1d

Please sign in to comment.