From 158b354c45ce770f75376f0c08ba5b791e4023d3 Mon Sep 17 00:00:00 2001 From: vijaybhagwat24 Date: Wed, 11 Sep 2024 15:17:40 +0530 Subject: [PATCH] fix: replace AssertJ's deprecated asList() DSL method in ContainerEnvJavaOptionsMergeVisitorTest (3379) --- .../ContainerEnvJavaOptionsMergeVisitorTest.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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")