Skip to content

Commit

Permalink
fix: replace AssertJ's deprecated asList() DSL method in DebugService…
Browse files Browse the repository at this point in the history
…Test (3378)
  • Loading branch information
vijaybhagwat24 authored Sep 10, 2024
1 parent 5e8937c commit 33dd3a1
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import io.fabric8.kubernetes.api.model.APIGroupListBuilder;
import io.fabric8.kubernetes.api.model.ConfigMap;
import io.fabric8.kubernetes.api.model.Container;
import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.kubernetes.api.model.LabelSelector;
import io.fabric8.kubernetes.api.model.LabelSelectorBuilder;
Expand Down Expand Up @@ -44,6 +45,7 @@
import io.fabric8.openshift.client.OpenShiftClient;
import io.fabric8.zjsonpatch.JsonPatch;
import okhttp3.mockwebserver.RecordedRequest;
import org.assertj.core.api.InstanceOfAssertFactories;
import org.assertj.core.groups.Tuple;
import org.eclipse.jkube.kit.common.JKubeConfiguration;
import org.eclipse.jkube.kit.common.JKubeException;
Expand Down Expand Up @@ -153,7 +155,7 @@ void enableDebuggingWithDeployment() {
debugService.enableDebugging(deployment, "file.name", false);
// Then
assertThat(kubernetesClient.apps().deployments().withName("test-app").get())
.extracting("spec.template.spec.containers").asList()
.extracting("spec.template.spec.containers").asInstanceOf(InstanceOfAssertFactories.list(Container.class))
.flatExtracting("env")
.extracting("name", "value")
.containsExactlyInAnyOrder(
Expand All @@ -169,7 +171,7 @@ void enableDebuggingWithReplicaSet() {
debugService.enableDebugging(replicaSet, "file.name", false);
// Then
assertThat(kubernetesClient.apps().replicaSets().withName("test-app").get())
.extracting("spec.template.spec.containers").asList()
.extracting("spec.template.spec.containers").asInstanceOf(InstanceOfAssertFactories.list(Container.class))
.flatExtracting("env")
.extracting("name", "value")
.containsExactlyInAnyOrder(
Expand All @@ -186,7 +188,7 @@ void enableDebuggingWithReplicationController() {
debugService.enableDebugging(replicationController, "file.name", false);
// Then
assertThat(kubernetesClient.replicationControllers().withName("test-app").get())
.extracting("spec.template.spec.containers").asList()
.extracting("spec.template.spec.containers").asInstanceOf(InstanceOfAssertFactories.list(Container.class))
.flatExtracting("env")
.extracting("name", "value")
.containsExactlyInAnyOrder(
Expand All @@ -210,7 +212,7 @@ void enableDebuggingWithDeploymentConfig() {
debugService.enableDebugging(deploymentConfig, "file.name", false);
// Then
assertThat(kubernetesClient.adapt(OpenShiftClient.class).deploymentConfigs().withName("test-app").get())
.extracting("spec.template.spec.containers").asList()
.extracting("spec.template.spec.containers").asInstanceOf(InstanceOfAssertFactories.list(Container.class))
.flatExtracting("env")
.extracting("name", "value")
.containsExactlyInAnyOrder(
Expand Down

0 comments on commit 33dd3a1

Please sign in to comment.