Fix validation of process args metadata in Paketo system tests

Fixes gh-35894
pull/37018/head
Scott Frederick 1 year ago
parent 4694e20628
commit 504d9fc50b

@ -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<ContainerConfigAssert,
return this.actual.extractingJsonPathArrayValue("$.buildpacks[*].id");
}
@SuppressWarnings("unchecked")
public AbstractListAssert<?, List<? extends String>, String, ObjectAssert<String>> processOfType(String type) {
return this.actual.extractingJsonPathArrayValue("$.processes[?(@.type=='%s')]", type)
.singleElement()
.extracting("command", "args")
.flatExtracting((list) -> (List<String>) list);
.flatMap((list) -> (list != null) ? ((List<?>) list).stream().map(Objects::toString).toList()
: Collections.emptyList());
}
}

Loading…
Cancel
Save