From b134cd4ea06ee7ce11ff715bfc90f0963be5f4a3 Mon Sep 17 00:00:00 2001 From: Shivam <96533413+ShivamChavan01@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:04:13 +0530 Subject: [PATCH] fix: replace AssertJ's deprecated asList() DSL method in ImageStreamServiceTest (3413) 3395-fix-assertj-aslist-in-imagestreamservices --- refactor: replace deprecated asList() with asInstanceOf(InstanceOfAssertFactories.list(type.class)) --- fix-assertj-aslist-in-imagestreamservices --- .../config/service/openshift/ImageStreamServiceTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jkube-kit/config/service/src/test/java/org/eclipse/jkube/kit/config/service/openshift/ImageStreamServiceTest.java b/jkube-kit/config/service/src/test/java/org/eclipse/jkube/kit/config/service/openshift/ImageStreamServiceTest.java index 27f7b7d1b1..99744eff6e 100644 --- a/jkube-kit/config/service/src/test/java/org/eclipse/jkube/kit/config/service/openshift/ImageStreamServiceTest.java +++ b/jkube-kit/config/service/src/test/java/org/eclipse/jkube/kit/config/service/openshift/ImageStreamServiceTest.java @@ -25,7 +25,9 @@ import java.util.Set; import io.fabric8.kubernetes.api.model.DefaultKubernetesResourceList; +import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.KubernetesList; +import io.fabric8.openshift.api.model.TagReference; import org.assertj.core.api.InstanceOfAssertFactories; import org.eclipse.jkube.kit.common.KitLogger; import org.eclipse.jkube.kit.common.util.Serialization; @@ -245,12 +247,12 @@ void appendImageStreamResource_whenMultipleTagsInImageStreamStatus_thenAddLatest assertThat(kubernetesList) .isNotNull() .extracting(DefaultKubernetesResourceList::getItems) - .asList() + .asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class)) .element(0) .asInstanceOf(InstanceOfAssertFactories.type(ImageStream.class)) .hasFieldOrPropertyWithValue("metadata.name", "foo") .extracting("spec.tags") - .asList() + .asInstanceOf(InstanceOfAssertFactories.list(TagReference.class)) .element(0) .hasFieldOrPropertyWithValue("name", "latest") .hasFieldOrPropertyWithValue("from.kind", "ImageStreamImage")