use of io.quarkus.builder.Version in project quarkus by quarkusio.
the class KubernetesWithQuarkusAppNameTest method assertGeneratedResources.
@Test
public void assertGeneratedResources() throws IOException {
Path kubernetesDir = prodModeTestResults.getBuildDir().resolve("kubernetes");
assertThat(kubernetesDir).isDirectoryContaining(p -> p.getFileName().endsWith("kubernetes.json")).isDirectoryContaining(p -> p.getFileName().endsWith("kubernetes.yml"));
List<HasMetadata> kubernetesList = DeserializationUtil.deserializeAsList(kubernetesDir.resolve("kubernetes.yml"));
assertThat(kubernetesList.get(0)).isInstanceOfSatisfying(Deployment.class, d -> {
assertThat(d.getMetadata()).satisfies(m -> {
assertThat(m.getName()).isEqualTo("foo");
assertThat(m.getLabels()).contains(entry("app.kubernetes.io/name", "foo"), entry("app.kubernetes.io/version", "1.0-kube"));
});
});
List<HasMetadata> openshiftList = DeserializationUtil.deserializeAsList(kubernetesDir.resolve("openshift.yml"));
assertThat(openshiftList).allSatisfy(h -> {
assertThat(h.getMetadata().getName()).isIn("ofoo", "foo", "openjdk-11");
assertThat(h.getMetadata().getLabels()).contains(entry("app.kubernetes.io/name", "ofoo"), entry("app.kubernetes.io/version", "1.0-openshift"));
});
}
Aggregations