diff --git a/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/assertions/ContainerConfigAssert.java b/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/assertions/ContainerConfigAssert.java index 6db0630252..e8dffb4b16 100644 --- a/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/assertions/ContainerConfigAssert.java +++ b/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/assertions/ContainerConfigAssert.java @@ -16,8 +16,10 @@ package org.springframework.boot.image.assertions; +import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.function.Consumer; import com.github.dockerjava.api.model.ContainerConfig; @@ -100,13 +102,12 @@ public class ContainerConfigAssert extends AbstractAssert, String, ObjectAssert> processOfType(String type) { return this.actual.extractingJsonPathArrayValue("$.processes[?(@.type=='%s')]", type) .singleElement() .extracting("command", "args") - .flatExtracting((list) -> (List) list); - + .flatMap((list) -> (list != null) ? ((List) list).stream().map(Objects::toString).toList() + : Collections.emptyList()); } }