diff --git a/testing-modules/mocks/src/test/java/com/baeldung/jimfs/FilePathReaderTest.java b/testing-modules/mocks/src/test/java/com/baeldung/jimfs/FilePathReaderUnitTest.java similarity index 51% rename from testing-modules/mocks/src/test/java/com/baeldung/jimfs/FilePathReaderTest.java rename to testing-modules/mocks/src/test/java/com/baeldung/jimfs/FilePathReaderUnitTest.java index 8a52bd3443..e5326fc84c 100644 --- a/testing-modules/mocks/src/test/java/com/baeldung/jimfs/FilePathReaderTest.java +++ b/testing-modules/mocks/src/test/java/com/baeldung/jimfs/FilePathReaderUnitTest.java @@ -11,19 +11,19 @@ import java.nio.file.Path; import static org.junit.jupiter.api.Assertions.assertEquals; -class FilePathReaderTest { +class FilePathReaderUnitTest { - private static String DIRECTORY_NAME = "baeldung"; + private static final String DIRECTORY_NAME = "baeldung"; - private FilePathReader filePathReader = new FilePathReader(); + private final FilePathReader filePathReader = new FilePathReader(); @Test @DisplayName("Should get path on windows") void shouldGetPath_onWindows() throws Exception { - FileSystem fileSystem = Jimfs.newFileSystem(Configuration.windows()); - Path path = getPathToFile(fileSystem); + final FileSystem fileSystem = Jimfs.newFileSystem(Configuration.windows()); + final Path path = getPathToFile(fileSystem); - String stringPath = filePathReader.getSystemPath(path); + final String stringPath = filePathReader.getSystemPath(path); assertEquals("C:\\work\\" + DIRECTORY_NAME, stringPath); } @@ -31,16 +31,16 @@ class FilePathReaderTest { @Test @DisplayName("Should get path on unix") void shouldGetPath_onUnix() throws Exception { - FileSystem fileSystem = Jimfs.newFileSystem(Configuration.unix()); - Path path = getPathToFile(fileSystem); + final FileSystem fileSystem = Jimfs.newFileSystem(Configuration.unix()); + final Path path = getPathToFile(fileSystem); - String stringPath = filePathReader.getSystemPath(path); + final String stringPath = filePathReader.getSystemPath(path); assertEquals("/work/" + DIRECTORY_NAME, stringPath); } - private Path getPathToFile(FileSystem fileSystem) throws Exception { - Path path = fileSystem.getPath(DIRECTORY_NAME); + private Path getPathToFile(final FileSystem fileSystem) throws Exception { + final Path path = fileSystem.getPath(DIRECTORY_NAME); Files.createDirectory(path); return path;