diff --git a/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/ContainerEnvJavaOptionsMergeVisitorTest.java b/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/ContainerEnvJavaOptionsMergeVisitorTest.java index 153ce438ff..880e5c886d 100644 --- a/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/ContainerEnvJavaOptionsMergeVisitorTest.java +++ b/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/ContainerEnvJavaOptionsMergeVisitorTest.java @@ -15,6 +15,9 @@ import java.util.Collections; + +import io.fabric8.kubernetes.api.model.apps.Deployment; +import org.assertj.core.api.InstanceOfAssertFactories; import org.eclipse.jkube.kit.config.image.ImageConfiguration; import io.fabric8.kubernetes.api.model.Container; @@ -72,7 +75,7 @@ void imageConfigurationAndContainersWithMatchingImageNameAndNoEnvShouldDoNothing kubernetesListBuilder.accept(new ContainerEnvJavaOptionsMergeEnricher .ContainerEnvJavaOptionsMergeVisitor(Collections.singletonList(imageConfiguration))); // Then - assertThat(kubernetesListBuilder.build().getItems()).asList() + assertThat(kubernetesListBuilder.build().getItems()).asInstanceOf(InstanceOfAssertFactories.list(Deployment.class)) .hasSize(1) .flatExtracting("spec.template.spec.containers") .flatExtracting("env").isEmpty(); @@ -91,7 +94,7 @@ void imageConfigurationWithJavaOptionsEnvAndContainersWithMatchingImageNameShoul kubernetesListBuilder.accept(new ContainerEnvJavaOptionsMergeEnricher .ContainerEnvJavaOptionsMergeVisitor(Collections.singletonList(imageConfiguration))); // Then - assertThat(kubernetesListBuilder.build().getItems()).asList() + assertThat(kubernetesListBuilder.build().getItems()).asInstanceOf(InstanceOfAssertFactories.list(Deployment.class)) .hasSize(1) .flatExtracting("spec.template.spec.containers") .flatExtracting("env").isEmpty(); @@ -114,7 +117,7 @@ void imageConfigurationWithJavaOptionsEnvAndContainersWithMatchingImageNameAndEn kubernetesListBuilder.accept(new ContainerEnvJavaOptionsMergeEnricher .ContainerEnvJavaOptionsMergeVisitor(Collections.singletonList(imageConfiguration))); // Then - assertThat(containerList(kubernetesListBuilder)).asList() + assertThat(containerList(kubernetesListBuilder)).asInstanceOf(InstanceOfAssertFactories.list(Container.class)) .hasSize(2) .filteredOn("image", "the-image:latest") .hasSize(1) @@ -123,7 +126,7 @@ void imageConfigurationWithJavaOptionsEnvAndContainersWithMatchingImageNameAndEn new EnvVar("JAVA_OPTIONS", "-DsomeOption -DotherOption", null), new EnvVar("OTHER", "OTHER_VALUE", null) ); - assertThat(containerList(kubernetesListBuilder)).asList() + assertThat(containerList(kubernetesListBuilder)).asInstanceOf(InstanceOfAssertFactories.list(Container.class)) .filteredOn("image", "other-image:latest") .hasSize(1) .flatExtracting("env")