Skip to content

Commit

Permalink
fix: broken test uses correct plugin and expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
iocanel committed Jan 22, 2022
1 parent 8f7aa5e commit c591a35
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@

import java.io.IOException;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.kubernetes.api.model.apps.Deployment;
import io.quarkus.bootstrap.model.AppArtifact;
import io.quarkus.builder.Version;
import io.quarkus.test.ProdBuildResults;
import io.quarkus.test.ProdModeTestResults;
import io.quarkus.test.QuarkusProdModeTest;
Expand All @@ -23,7 +26,11 @@ public class KubernetesWithQuarkusAppNameTest {
.withApplicationRoot((jar) -> jar.addClasses(GreetingResource.class))
.setApplicationName("kubernetes-with-quarkus-app-name")
.setApplicationVersion("0.1-SNAPSHOT")
.withConfigurationResource("kubernetes-with-quarkus-app-name.properties");
.withConfigurationResource("kubernetes-with-quarkus-app-name.properties")
.setForcedDependencies(
Arrays.asList(
new AppArtifact("io.quarkus", "quarkus-kubernetes", Version.getVersion()),
new AppArtifact("io.quarkus", "quarkus-container-image-s2i", Version.getVersion())));

@ProdBuildResults
private ProdModeTestResults prodModeTestResults;
Expand All @@ -48,7 +55,7 @@ public void assertGeneratedResources() throws IOException {
List<HasMetadata> openshiftList = DeserializationUtil
.deserializeAsList(kubernetesDir.resolve("openshift.yml"));
assertThat(openshiftList).allSatisfy(h -> {
assertThat(h.getMetadata().getName()).isIn("ofoo", "s2ifoo", "s2i-java");
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"));
});
Expand Down

0 comments on commit c591a35

Please sign in to comment.