From 766d3361e3fe89028efdd0cccb2856c0e99761f4 Mon Sep 17 00:00:00 2001 From: Dakota Dunn <159508874+heap-s@users.noreply.github.com> Date: Thu, 29 Aug 2024 09:45:38 -0400 Subject: [PATCH] fix: replace AssertJ's deprecated asList() DSL method in KubernetesResourceUtilTest (3349) Signed-off-by: heap-s --- .../enricher/api/util/KubernetesResourceUtilTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jkube-kit/enricher/api/src/test/java/org/eclipse/jkube/kit/enricher/api/util/KubernetesResourceUtilTest.java b/jkube-kit/enricher/api/src/test/java/org/eclipse/jkube/kit/enricher/api/util/KubernetesResourceUtilTest.java index 5a42183664..e58c060dc4 100644 --- a/jkube-kit/enricher/api/src/test/java/org/eclipse/jkube/kit/enricher/api/util/KubernetesResourceUtilTest.java +++ b/jkube-kit/enricher/api/src/test/java/org/eclipse/jkube/kit/enricher/api/util/KubernetesResourceUtilTest.java @@ -166,7 +166,7 @@ void mergePodSpec_withFragmentWithNoContainerNameAndSidecarDisabled_shouldGetCon .hasFieldOrPropertyWithValue("resources.requests.memory.amount", "256") .hasFieldOrPropertyWithValue("resources.limits.cpu.amount", "1.0") .hasFieldOrPropertyWithValue("resources.limits.memory.amount", "512") - .extracting("ports").asList().extracting("containerPort") + .extracting("ports").asInstanceOf(InstanceOfAssertFactories.list(ContainerPort.class)).extracting("containerPort") .containsExactly(8080, 9779, 8778); } @@ -300,7 +300,7 @@ void mergeResources_whenDeploymentProvidedAndFirstDeploymentWithEmptySpec_thenSh .extracting(DeploymentSpec::getTemplate) .extracting(PodTemplateSpec::getSpec) .extracting(PodSpec::getContainers) - .asList() + .asInstanceOf(InstanceOfAssertFactories.list(Container.class)) .singleElement(InstanceOfAssertFactories.type(Container.class)) .hasFieldOrPropertyWithValue("env", Collections.singletonList(new EnvVarBuilder().withName("E1").withValue("V1").build())) .hasFieldOrPropertyWithValue("name", "foo"); @@ -338,7 +338,7 @@ void mergeResources_whenDeploymentProvidedAndSecondDeploymentWithEmptySpec_thenS .extracting(DeploymentSpec::getTemplate) .extracting(PodTemplateSpec::getSpec) .extracting(PodSpec::getContainers) - .asList() + .asInstanceOf(InstanceOfAssertFactories.list(Container.class)) .singleElement(InstanceOfAssertFactories.type(Container.class)) .hasFieldOrPropertyWithValue("name", "foo"); } @@ -393,7 +393,7 @@ void mergeResources_whenBothDeploymentNonEmptySpec_thenShouldMergeBothObjects() .extracting(DeploymentSpec::getTemplate) .extracting(PodTemplateSpec::getSpec) .extracting(PodSpec::getContainers) - .asList() + .asInstanceOf(InstanceOfAssertFactories.list(Container.class)) .singleElement(InstanceOfAssertFactories.type(Container.class)) .hasFieldOrPropertyWithValue("name", "c1"); } @@ -486,7 +486,7 @@ void mergeResources_whenPodsProvided_thenMergeBothPodMetadataOnly() { .hasFieldOrPropertyWithValue("metadata.labels.l2", "v2") .extracting(Pod::getSpec) .extracting(PodSpec::getContainers) - .asList() + .asInstanceOf(InstanceOfAssertFactories.list(Container.class)) .singleElement(InstanceOfAssertFactories.type(Container.class)) .hasFieldOrPropertyWithValue("name", "c1") .hasFieldOrPropertyWithValue("image", "image1:latest");