"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/LifecycleTests.java" between
spring-boot-2.7.3.tar.gz and spring-boot-2.7.4.tar.gz

About: Spring Boot helps to create Spring-powered, production-grade applications and services.

LifecycleTests.java  (spring-boot-2.7.3):LifecycleTests.java  (spring-boot-2.7.4)
skipping to change at line 31 skipping to change at line 31
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.PrintStream; import java.io.PrintStream;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ArrayNode;
import com.sun.jna.Platform;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.mockito.stubbing.Answer; import org.mockito.stubbing.Answer;
import org.skyscreamer.jsonassert.JSONAssert;
import org.springframework.boot.buildpack.platform.docker.DockerApi; import org.springframework.boot.buildpack.platform.docker.DockerApi;
import org.springframework.boot.buildpack.platform.docker.DockerApi.ContainerApi ; import org.springframework.boot.buildpack.platform.docker.DockerApi.ContainerApi ;
import org.springframework.boot.buildpack.platform.docker.DockerApi.ImageApi; import org.springframework.boot.buildpack.platform.docker.DockerApi.ImageApi;
import org.springframework.boot.buildpack.platform.docker.DockerApi.VolumeApi; import org.springframework.boot.buildpack.platform.docker.DockerApi.VolumeApi;
import org.springframework.boot.buildpack.platform.docker.configuration.DockerHo st; import org.springframework.boot.buildpack.platform.docker.configuration.DockerHo st;
import org.springframework.boot.buildpack.platform.docker.configuration.Resolved DockerHost; import org.springframework.boot.buildpack.platform.docker.configuration.Resolved DockerHost;
import org.springframework.boot.buildpack.platform.docker.type.Binding; import org.springframework.boot.buildpack.platform.docker.type.Binding;
import org.springframework.boot.buildpack.platform.docker.type.ContainerConfig; import org.springframework.boot.buildpack.platform.docker.type.ContainerConfig;
import org.springframework.boot.buildpack.platform.docker.type.ContainerContent; import org.springframework.boot.buildpack.platform.docker.type.ContainerContent;
skipping to change at line 321 skipping to change at line 325
private void assertPhaseWasRun(String name, IOConsumer<ContainerConfig> c onfigConsumer) throws IOException { private void assertPhaseWasRun(String name, IOConsumer<ContainerConfig> c onfigConsumer) throws IOException {
ContainerReference containerReference = ContainerReference.of("cn b-lifecycle-" + name); ContainerReference containerReference = ContainerReference.of("cn b-lifecycle-" + name);
then(this.docker.container()).should().start(containerReference); then(this.docker.container()).should().start(containerReference);
then(this.docker.container()).should().logs(eq(containerReference ), any()); then(this.docker.container()).should().logs(eq(containerReference ), any());
then(this.docker.container()).should().remove(containerReference, true); then(this.docker.container()).should().remove(containerReference, true);
configConsumer.accept(this.configs.get(containerReference.toStrin g())); configConsumer.accept(this.configs.get(containerReference.toStrin g()));
} }
private IOConsumer<ContainerConfig> withExpectedConfig(String name) { private IOConsumer<ContainerConfig> withExpectedConfig(String name) {
return (config) -> { return (config) -> {
InputStream in = getClass().getResourceAsStream(name); try {
String json = FileCopyUtils.copyToString(new InputStreamR InputStream in = getClass().getResourceAsStream(n
eader(in, StandardCharsets.UTF_8)); ame);
assertThat(config.toString()).isEqualToIgnoringWhitespace String jsonString = FileCopyUtils.copyToString(ne
(json); w InputStreamReader(in, StandardCharsets.UTF_8));
JSONObject json = new JSONObject(jsonString);
if (Platform.isWindows()) {
JSONObject hostConfig = json.getJSONObjec
t("HostConfig");
hostConfig.remove("SecurityOpt");
}
JSONAssert.assertEquals(config.toString(), json,
true);
}
catch (JSONException ex) {
throw new IOException(ex);
}
}; };
} }
static class TestLifecycle extends Lifecycle { static class TestLifecycle extends Lifecycle {
TestLifecycle(BuildLog log, DockerApi docker, ResolvedDockerHost dockerHost, BuildRequest request, TestLifecycle(BuildLog log, DockerApi docker, ResolvedDockerHost dockerHost, BuildRequest request,
EphemeralBuilder builder) { EphemeralBuilder builder) {
super(log, docker, dockerHost, request, builder); super(log, docker, dockerHost, request, builder);
} }
 End of changes. 3 change blocks. 
5 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)