mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Fix validation of process args metadata in Paketo system tests
Fixes gh-35894
This commit is contained in:
parent
4694e20628
commit
504d9fc50b
@ -16,8 +16,10 @@
|
|||||||
|
|
||||||
package org.springframework.boot.image.assertions;
|
package org.springframework.boot.image.assertions;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import com.github.dockerjava.api.model.ContainerConfig;
|
import com.github.dockerjava.api.model.ContainerConfig;
|
||||||
@ -100,13 +102,12 @@ public class ContainerConfigAssert extends AbstractAssert<ContainerConfigAssert,
|
|||||||
return this.actual.extractingJsonPathArrayValue("$.buildpacks[*].id");
|
return this.actual.extractingJsonPathArrayValue("$.buildpacks[*].id");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public AbstractListAssert<?, List<? extends String>, String, ObjectAssert<String>> processOfType(String type) {
|
public AbstractListAssert<?, List<? extends String>, String, ObjectAssert<String>> processOfType(String type) {
|
||||||
return this.actual.extractingJsonPathArrayValue("$.processes[?(@.type=='%s')]", type)
|
return this.actual.extractingJsonPathArrayValue("$.processes[?(@.type=='%s')]", type)
|
||||||
.singleElement()
|
.singleElement()
|
||||||
.extracting("command", "args")
|
.extracting("command", "args")
|
||||||
.flatExtracting((list) -> (List<String>) list);
|
.flatMap((list) -> (list != null) ? ((List<?>) list).stream().map(Objects::toString).toList()
|
||||||
|
: Collections.emptyList());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user