Skip to content

Commit

Permalink
fix: replace AssertJ's deprecated asList() DSL method in ImageStreamS…
Browse files Browse the repository at this point in the history
…erviceTest (3413)

3395-fix-assertj-aslist-in-imagestreamservices
---
refactor: replace deprecated asList() with asInstanceOf(InstanceOfAssertFactories.list(type.class))
---
fix-assertj-aslist-in-imagestreamservices
  • Loading branch information
ShivamChavan01 authored Oct 2, 2024
1 parent eb29732 commit b134cd4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit b134cd4

Please sign in to comment.