Polish
This commit is contained in:
@@ -83,9 +83,14 @@ public abstract class AbstractDockerComposeIntegrationTests {
|
|||||||
private File transformedComposeFile(File composeFile, DockerImageName imageName) {
|
private File transformedComposeFile(File composeFile, DockerImageName imageName) {
|
||||||
File tempComposeFile = Path.of(tempDir.toString(), composeFile.getName()).toFile();
|
File tempComposeFile = Path.of(tempDir.toString(), composeFile.getName()).toFile();
|
||||||
try {
|
try {
|
||||||
String composeFileContent = FileCopyUtils.copyToString(new FileReader(composeFile));
|
String composeFileContent;
|
||||||
|
try (FileReader reader = new FileReader(composeFile)) {
|
||||||
|
composeFileContent = FileCopyUtils.copyToString(reader);
|
||||||
|
}
|
||||||
composeFileContent = composeFileContent.replace("{imageName}", imageName.asCanonicalNameString());
|
composeFileContent = composeFileContent.replace("{imageName}", imageName.asCanonicalNameString());
|
||||||
FileCopyUtils.copy(composeFileContent, new FileWriter(tempComposeFile));
|
try (FileWriter writer = new FileWriter(tempComposeFile)) {
|
||||||
|
FileCopyUtils.copy(composeFileContent, writer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (IOException ex) {
|
catch (IOException ex) {
|
||||||
fail("Error transforming Docker compose file '" + composeFile + "' to '" + tempComposeFile + "': "
|
fail("Error transforming Docker compose file '" + composeFile + "' to '" + tempComposeFile + "': "
|
||||||
|
|||||||
Reference in New Issue
Block a user