Skip to content

Commit

Permalink
fix: replace AssertJ's deprecated asList() DSL method in KubernetesRe…
Browse files Browse the repository at this point in the history
…sourceUtilTest (3349)

Signed-off-by: heap-s <[email protected]>
  • Loading branch information
heap-s authored Aug 29, 2024
1 parent 3d2eead commit 766d336
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void mergePodSpec_withFragmentWithNoContainerNameAndSidecarDisabled_shouldGetCon
.hasFieldOrPropertyWithValue("resources.requests.memory.amount", "256")
.hasFieldOrPropertyWithValue("resources.limits.cpu.amount", "1.0")
.hasFieldOrPropertyWithValue("resources.limits.memory.amount", "512")
.extracting("ports").asList().extracting("containerPort")
.extracting("ports").asInstanceOf(InstanceOfAssertFactories.list(ContainerPort.class)).extracting("containerPort")
.containsExactly(8080, 9779, 8778);
}

Expand Down Expand Up @@ -300,7 +300,7 @@ void mergeResources_whenDeploymentProvidedAndFirstDeploymentWithEmptySpec_thenSh
.extracting(DeploymentSpec::getTemplate)
.extracting(PodTemplateSpec::getSpec)
.extracting(PodSpec::getContainers)
.asList()
.asInstanceOf(InstanceOfAssertFactories.list(Container.class))
.singleElement(InstanceOfAssertFactories.type(Container.class))
.hasFieldOrPropertyWithValue("env", Collections.singletonList(new EnvVarBuilder().withName("E1").withValue("V1").build()))
.hasFieldOrPropertyWithValue("name", "foo");
Expand Down Expand Up @@ -338,7 +338,7 @@ void mergeResources_whenDeploymentProvidedAndSecondDeploymentWithEmptySpec_thenS
.extracting(DeploymentSpec::getTemplate)
.extracting(PodTemplateSpec::getSpec)
.extracting(PodSpec::getContainers)
.asList()
.asInstanceOf(InstanceOfAssertFactories.list(Container.class))
.singleElement(InstanceOfAssertFactories.type(Container.class))
.hasFieldOrPropertyWithValue("name", "foo");
}
Expand Down Expand Up @@ -393,7 +393,7 @@ void mergeResources_whenBothDeploymentNonEmptySpec_thenShouldMergeBothObjects()
.extracting(DeploymentSpec::getTemplate)
.extracting(PodTemplateSpec::getSpec)
.extracting(PodSpec::getContainers)
.asList()
.asInstanceOf(InstanceOfAssertFactories.list(Container.class))
.singleElement(InstanceOfAssertFactories.type(Container.class))
.hasFieldOrPropertyWithValue("name", "c1");
}
Expand Down Expand Up @@ -486,7 +486,7 @@ void mergeResources_whenPodsProvided_thenMergeBothPodMetadataOnly() {
.hasFieldOrPropertyWithValue("metadata.labels.l2", "v2")
.extracting(Pod::getSpec)
.extracting(PodSpec::getContainers)
.asList()
.asInstanceOf(InstanceOfAssertFactories.list(Container.class))
.singleElement(InstanceOfAssertFactories.type(Container.class))
.hasFieldOrPropertyWithValue("name", "c1")
.hasFieldOrPropertyWithValue("image", "image1:latest");
Expand Down

0 comments on commit 766d336

Please sign in to comment.