This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 63dab1ed37189d73bf2953e728df224446d2bdf2 Author: Gary Gregory <[email protected]> AuthorDate: Mon Dec 2 08:30:33 2024 -0500 Use final Remove blank lines --- .../org/apache/commons/lang3/RuntimeEnvironmentTest.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/test/java/org/apache/commons/lang3/RuntimeEnvironmentTest.java b/src/test/java/org/apache/commons/lang3/RuntimeEnvironmentTest.java index 9b5a68f11..19213be1f 100644 --- a/src/test/java/org/apache/commons/lang3/RuntimeEnvironmentTest.java +++ b/src/test/java/org/apache/commons/lang3/RuntimeEnvironmentTest.java @@ -63,27 +63,24 @@ public class RuntimeEnvironmentTest { @TempDir private Path tempDir; - private boolean doTestInContainer(String environ, String fileToCreate) throws IOException { - Path testDir = tempDir.resolve(UUID.randomUUID().toString()); - Path pid1EnvironFile = testDir.resolve("proc/1/environ"); + private boolean doTestInContainer(final String environ, final String fileToCreate) throws IOException { + final Path testDir = tempDir.resolve(UUID.randomUUID().toString()); + final Path pid1EnvironFile = testDir.resolve("proc/1/environ"); Files.createDirectories(pid1EnvironFile.getParent()); - if (fileToCreate != null) { - Path file = testDir.resolve(fileToCreate); + final Path file = testDir.resolve(fileToCreate); Files.createDirectories(file.getParent()); Files.createFile(file); } - if (environ != null) { Files.write(pid1EnvironFile, environ.getBytes(StandardCharsets.UTF_8)); } - return RuntimeEnvironment.inContainer(testDir.toString()); } @ParameterizedTest @MethodSource - public void testIsContainer(String label, String environ, String fileToCreate, boolean expected) throws IOException { + public void testIsContainer(final String label, final String environ, final String fileToCreate, final boolean expected) throws IOException { assertEquals(expected, doTestInContainer(environ, fileToCreate), label); } }
