diff --git a/jkube-kit/enricher/api/src/test/java/org/eclipse/jkube/kit/enricher/handler/PodTemplateHandlerTest.java b/jkube-kit/enricher/api/src/test/java/org/eclipse/jkube/kit/enricher/handler/PodTemplateHandlerTest.java index 137b7c6270..1585a133af 100644 --- a/jkube-kit/enricher/api/src/test/java/org/eclipse/jkube/kit/enricher/handler/PodTemplateHandlerTest.java +++ b/jkube-kit/enricher/api/src/test/java/org/eclipse/jkube/kit/enricher/handler/PodTemplateHandlerTest.java @@ -16,6 +16,8 @@ import io.fabric8.kubernetes.api.model.LocalObjectReference; import io.fabric8.kubernetes.api.model.PodSpec; import io.fabric8.kubernetes.api.model.PodTemplateSpec; +import io.fabric8.kubernetes.api.model.Volume; +import io.fabric8.kubernetes.api.model.Container; import org.assertj.core.api.InstanceOfAssertFactories; import org.eclipse.jkube.kit.config.image.build.BuildConfiguration; import org.eclipse.jkube.kit.config.image.ImageConfiguration; @@ -87,7 +89,7 @@ void getPodTemplate_withoutVolumeConfig_shouldGeneratePodTemplateWithoutVolume() assertThat(podTemplateSpec.getSpec().getVolumes()).isEmpty(); assertThat(podTemplateSpec.getSpec()) .extracting(PodSpec::getContainers).isNotNull() - .asList() + .asInstanceOf(InstanceOfAssertFactories.list(Container.class)) .first() .hasFieldOrPropertyWithValue("name", "test-app") .hasFieldOrPropertyWithValue("image", "docker.io/test:latest") @@ -105,10 +107,10 @@ void getPodTemplate_withEmptyVolumeAndWithoutServiceAccount_shouldGeneratePodTem PodTemplateSpec podTemplateSpec = podTemplateHandler.getPodTemplate(config, null, images); assertThat(podTemplateSpec.getSpec()) - .hasFieldOrPropertyWithValue("serviceAccountName", null) - .returns(true, spec -> spec.getVolumes().isEmpty()) - .extracting(PodSpec::getContainers) - .isNotNull(); + .hasFieldOrPropertyWithValue("serviceAccountName", null) + .returns(true, spec -> spec.getVolumes().isEmpty()) + .extracting(PodSpec::getContainers) + .isNotNull(); } @Test @@ -128,7 +130,8 @@ void getPodTemplate_withVolumeAndServiceAccount_shouldGeneratePodTemplateWithCon assertThat(podTemplateSpec.getSpec().getContainers()).isNotNull(); assertThat(podTemplateSpec.getSpec()) - .extracting(PodSpec::getVolumes).asList() + .extracting(PodSpec::getVolumes) + .asInstanceOf(InstanceOfAssertFactories.list(Volume.class)) .isNotEmpty() .first() .hasFieldOrPropertyWithValue("name", "test")