Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed deprected method asList() #3510

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
package org.eclipse.jkube.enricher.generic.openshift;

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;
Expand Down Expand Up @@ -54,7 +55,9 @@ void create_withNoServices_shouldNotCreateRoute() {
// When
new RouteEnricher(context).create(PlatformMode.openshift, klb);
// Then
assertThat(klb.build()).extracting(KubernetesList::getItems).asList().isEmpty();
assertThat(klb.build()).extracting(KubernetesList::getItems)
.asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class))
.isEmpty();
}

@Test
Expand All @@ -65,8 +68,10 @@ void create_withServiceNotExposed_shouldNotCreateRoute() {
// When
new RouteEnricher(context).create(PlatformMode.openshift, klb);
// Then
assertThat(klb.build()).extracting(KubernetesList::getItems).asList().singleElement()
.isInstanceOf(Service.class);
assertThat(klb.build()).extracting(KubernetesList::getItems)
.asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class))
.singleElement()
.isInstanceOf(Service.class);
}

@Test
Expand All @@ -77,7 +82,9 @@ void create_withServiceWithNoWebPort_shouldNotCreateRoute() {
// When
new RouteEnricher(context).create(PlatformMode.openshift, 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);
}

Expand Down Expand Up @@ -115,7 +122,9 @@ void inKubernetes_shouldNotCreateRoute() {
// When
new RouteEnricher(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);
}

Expand Down