ContainerConfigTests.java (spring-boot-2.7.3) | : | ContainerConfigTests.java (spring-boot-2.7.4) | ||
---|---|---|---|---|
/* | /* | |||
* Copyright 2012-2021 the original author or authors. | * Copyright 2012-2022 the original author or authors. | |||
* | * | |||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | |||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | |||
* You may obtain a copy of the License at | * You may obtain a copy of the License at | |||
* | * | |||
* https://www.apache.org/licenses/LICENSE-2.0 | * https://www.apache.org/licenses/LICENSE-2.0 | |||
* | * | |||
* Unless required by applicable law or agreed to in writing, software | * Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | * distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
skipping to change at line 64 | skipping to change at line 64 | |||
ImageReference imageReference = ImageReference.of("ubuntu:bionic" ); | ImageReference imageReference = ImageReference.of("ubuntu:bionic" ); | |||
ContainerConfig containerConfig = ContainerConfig.of(imageReferen ce, (update) -> { | ContainerConfig containerConfig = ContainerConfig.of(imageReferen ce, (update) -> { | |||
update.withUser("root"); | update.withUser("root"); | |||
update.withCommand("ls", "-l"); | update.withCommand("ls", "-l"); | |||
update.withArgs("-h"); | update.withArgs("-h"); | |||
update.withLabel("spring", "boot"); | update.withLabel("spring", "boot"); | |||
update.withBinding(Binding.from("bind-source", "bind-dest ")); | update.withBinding(Binding.from("bind-source", "bind-dest ")); | |||
update.withEnv("name1", "value1"); | update.withEnv("name1", "value1"); | |||
update.withEnv("name2", "value2"); | update.withEnv("name2", "value2"); | |||
update.withNetworkMode("test"); | update.withNetworkMode("test"); | |||
update.withSecurityOption("option=value"); | ||||
}); | }); | |||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); | ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); | |||
containerConfig.writeTo(outputStream); | containerConfig.writeTo(outputStream); | |||
String actualJson = new String(outputStream.toByteArray(), Standa rdCharsets.UTF_8); | String actualJson = new String(outputStream.toByteArray(), Standa rdCharsets.UTF_8); | |||
String expectedJson = StreamUtils.copyToString(getContent("contai ner-config.json"), StandardCharsets.UTF_8); | String expectedJson = StreamUtils.copyToString(getContent("contai ner-config.json"), StandardCharsets.UTF_8); | |||
JSONAssert.assertEquals(expectedJson, actualJson, false); | JSONAssert.assertEquals(expectedJson, actualJson, true); | |||
} | } | |||
} | } | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 3 lines changed or added |