Skip to content

Commit

Permalink
fix: replace AssertJ's deprecated asList() DSL method in VolumePermis…
Browse files Browse the repository at this point in the history
…sionEnricherTest (3392)
  • Loading branch information
ShivamChavan01 authored Sep 19, 2024
1 parent ff3fd27 commit d2afc38
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ void alreadyExistingInitContainer() {
.extracting(PodTemplate::getTemplate)
.extracting(PodTemplateSpec::getSpec)
.extracting(PodSpec::getInitContainers)
.asList()
.singleElement(InstanceOfAssertFactories.type(Container.class))
.asInstanceOf(InstanceOfAssertFactories.list(Container.class))
.singleElement()
.hasFieldOrPropertyWithValue("resources", null)
.extracting(Container::getVolumeMounts)
.asList()
.singleElement(InstanceOfAssertFactories.type(VolumeMount.class))
.asInstanceOf(InstanceOfAssertFactories.list(VolumeMount.class))
.singleElement()
.extracting(VolumeMount::getMountPath)
.isEqualTo("blub");
}
Expand Down Expand Up @@ -147,8 +147,8 @@ void adapt() {
.extracting(PodTemplate::getTemplate)
.extracting(PodTemplateSpec::getSpec)
.extracting(PodSpec::getInitContainers)
.asList()
.singleElement(InstanceOfAssertFactories.type(Container.class))
.asInstanceOf(InstanceOfAssertFactories.list(Container.class))
.singleElement()
.hasFieldOrPropertyWithValue("image", tc.imageName)
.hasFieldOrPropertyWithValue("name", tc.initContainerName)
.hasFieldOrPropertyWithValue("command", getExpectedCommand(tc))
Expand Down Expand Up @@ -210,8 +210,8 @@ void enrich_whenCustomInitContainerImageProvided_thenUseThatContainerImageInInit
.extracting(PodTemplate::getTemplate)
.extracting(PodTemplateSpec::getSpec)
.extracting(PodSpec::getInitContainers)
.asList()
.singleElement(InstanceOfAssertFactories.type(Container.class))
.asInstanceOf(InstanceOfAssertFactories.list(Container.class))
.singleElement()
.hasFieldOrPropertyWithValue("image", "example.org/foo/bar:latest");
}

Expand Down Expand Up @@ -245,8 +245,8 @@ void enrich_withResourcesEnabledInConfiguration_shouldAddRequestsLimitsToVolumeI
.extracting(PodTemplate::getTemplate)
.extracting(PodTemplateSpec::getSpec)
.extracting(PodSpec::getInitContainers)
.asList()
.singleElement(InstanceOfAssertFactories.type(Container.class))
.asInstanceOf(InstanceOfAssertFactories.list(Container.class))
.singleElement()
.extracting(Container::getResources)
.hasFieldOrPropertyWithValue("requests", requestsMap)
.hasFieldOrPropertyWithValue("limits", limitMap);
Expand Down

0 comments on commit d2afc38

Please sign in to comment.