diff --git a/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/IngressEnricherBehavioralTest.java b/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/IngressEnricherBehavioralTest.java index 7d84b28f87..8a1d1c0904 100644 --- a/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/IngressEnricherBehavioralTest.java +++ b/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/IngressEnricherBehavioralTest.java @@ -13,10 +13,13 @@ */ package org.eclipse.jkube.enricher.generic; +import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.KubernetesList; import io.fabric8.kubernetes.api.model.KubernetesListBuilder; import io.fabric8.kubernetes.api.model.Service; import io.fabric8.kubernetes.api.model.networking.v1.IngressBuilder; + +import org.assertj.core.api.InstanceOfAssertFactories; import org.eclipse.jkube.kit.common.JavaProject; import org.eclipse.jkube.kit.common.KitLogger; import org.eclipse.jkube.kit.config.resource.PlatformMode; @@ -53,7 +56,7 @@ void create_withNoServices_shouldNotCreateIngress() { // When new IngressEnricher(context).create(PlatformMode.kubernetes, klb); // Then - assertThat(klb.build()).extracting(KubernetesList::getItems).asList().isEmpty(); + assertThat(klb.build()).extracting(KubernetesList::getItems).asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class)).isEmpty(); } @Test @@ -64,7 +67,7 @@ void create_withServicesAndNoExternalUrls_shouldNotCreateIngress() { // When new IngressEnricher(context).create(PlatformMode.kubernetes, klb); // Then - assertThat(klb.build()).extracting(KubernetesList::getItems).asList().singleElement() + assertThat(klb.build()).extracting(KubernetesList::getItems).asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class)).singleElement() .isInstanceOf(Service.class); } @@ -112,7 +115,7 @@ void create_withServiceNotExposed_shouldNotCreateIngress() { // When new IngressEnricher(context).create(PlatformMode.kubernetes, klb); // Then - assertThat(klb.build()).extracting(KubernetesList::getItems).asList().singleElement() + assertThat(klb.build()).extracting(KubernetesList::getItems).asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class)).singleElement() .isInstanceOf(Service.class); } @@ -131,7 +134,7 @@ void create_withServices_shouldCreateNetworkingIngress() { .hasFieldOrPropertyWithValue("metadata.name", "http") .hasFieldOrPropertyWithValue("spec.defaultBackend.service.name", "http") .hasFieldOrPropertyWithValue("spec.defaultBackend.service.port.number", 80) - .extracting("spec.rules").asList().isEmpty(); + .extracting("spec.rules").asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class)).isEmpty(); } @Test @@ -150,6 +153,6 @@ void create_withServicesAndTargetExtensions_shouldCreateExtensionsIngress() { .hasFieldOrPropertyWithValue("metadata.name", "http") .hasFieldOrPropertyWithValue("spec.backend.serviceName", "http") .hasFieldOrPropertyWithValue("spec.backend.servicePort.value", 80) - .extracting("spec.rules").asList().isEmpty(); + .extracting("spec.rules").asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class)).isEmpty(); } }