Skip to content

Commit 766d336

Browse files
authored
fix: replace AssertJ's deprecated asList() DSL method in KubernetesResourceUtilTest (3349)
Signed-off-by: heap-s <[email protected]>
1 parent 3d2eead commit 766d336

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

jkube-kit/enricher/api/src/test/java/org/eclipse/jkube/kit/enricher/api/util/KubernetesResourceUtilTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void mergePodSpec_withFragmentWithNoContainerNameAndSidecarDisabled_shouldGetCon
166166
.hasFieldOrPropertyWithValue("resources.requests.memory.amount", "256")
167167
.hasFieldOrPropertyWithValue("resources.limits.cpu.amount", "1.0")
168168
.hasFieldOrPropertyWithValue("resources.limits.memory.amount", "512")
169-
.extracting("ports").asList().extracting("containerPort")
169+
.extracting("ports").asInstanceOf(InstanceOfAssertFactories.list(ContainerPort.class)).extracting("containerPort")
170170
.containsExactly(8080, 9779, 8778);
171171
}
172172

@@ -300,7 +300,7 @@ void mergeResources_whenDeploymentProvidedAndFirstDeploymentWithEmptySpec_thenSh
300300
.extracting(DeploymentSpec::getTemplate)
301301
.extracting(PodTemplateSpec::getSpec)
302302
.extracting(PodSpec::getContainers)
303-
.asList()
303+
.asInstanceOf(InstanceOfAssertFactories.list(Container.class))
304304
.singleElement(InstanceOfAssertFactories.type(Container.class))
305305
.hasFieldOrPropertyWithValue("env", Collections.singletonList(new EnvVarBuilder().withName("E1").withValue("V1").build()))
306306
.hasFieldOrPropertyWithValue("name", "foo");
@@ -338,7 +338,7 @@ void mergeResources_whenDeploymentProvidedAndSecondDeploymentWithEmptySpec_thenS
338338
.extracting(DeploymentSpec::getTemplate)
339339
.extracting(PodTemplateSpec::getSpec)
340340
.extracting(PodSpec::getContainers)
341-
.asList()
341+
.asInstanceOf(InstanceOfAssertFactories.list(Container.class))
342342
.singleElement(InstanceOfAssertFactories.type(Container.class))
343343
.hasFieldOrPropertyWithValue("name", "foo");
344344
}
@@ -393,7 +393,7 @@ void mergeResources_whenBothDeploymentNonEmptySpec_thenShouldMergeBothObjects()
393393
.extracting(DeploymentSpec::getTemplate)
394394
.extracting(PodTemplateSpec::getSpec)
395395
.extracting(PodSpec::getContainers)
396-
.asList()
396+
.asInstanceOf(InstanceOfAssertFactories.list(Container.class))
397397
.singleElement(InstanceOfAssertFactories.type(Container.class))
398398
.hasFieldOrPropertyWithValue("name", "c1");
399399
}
@@ -486,7 +486,7 @@ void mergeResources_whenPodsProvided_thenMergeBothPodMetadataOnly() {
486486
.hasFieldOrPropertyWithValue("metadata.labels.l2", "v2")
487487
.extracting(Pod::getSpec)
488488
.extracting(PodSpec::getContainers)
489-
.asList()
489+
.asInstanceOf(InstanceOfAssertFactories.list(Container.class))
490490
.singleElement(InstanceOfAssertFactories.type(Container.class))
491491
.hasFieldOrPropertyWithValue("name", "c1")
492492
.hasFieldOrPropertyWithValue("image", "image1:latest");

0 commit comments

Comments
 (0)