[ BAEL-3322 ] : Fix test name

This commit is contained in:
Lukasz Rys
2019-10-14 00:25:27 +02:00
parent 0b7a7f6221
commit e6ff0cd990

View File

@@ -11,19 +11,19 @@ import java.nio.file.Path;
import static org.junit.jupiter.api.Assertions.assertEquals; 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 @Test
@DisplayName("Should get path on windows") @DisplayName("Should get path on windows")
void shouldGetPath_onWindows() throws Exception { void shouldGetPath_onWindows() throws Exception {
FileSystem fileSystem = Jimfs.newFileSystem(Configuration.windows()); final FileSystem fileSystem = Jimfs.newFileSystem(Configuration.windows());
Path path = getPathToFile(fileSystem); final Path path = getPathToFile(fileSystem);
String stringPath = filePathReader.getSystemPath(path); final String stringPath = filePathReader.getSystemPath(path);
assertEquals("C:\\work\\" + DIRECTORY_NAME, stringPath); assertEquals("C:\\work\\" + DIRECTORY_NAME, stringPath);
} }
@@ -31,16 +31,16 @@ class FilePathReaderTest {
@Test @Test
@DisplayName("Should get path on unix") @DisplayName("Should get path on unix")
void shouldGetPath_onUnix() throws Exception { void shouldGetPath_onUnix() throws Exception {
FileSystem fileSystem = Jimfs.newFileSystem(Configuration.unix()); final FileSystem fileSystem = Jimfs.newFileSystem(Configuration.unix());
Path path = getPathToFile(fileSystem); final Path path = getPathToFile(fileSystem);
String stringPath = filePathReader.getSystemPath(path); final String stringPath = filePathReader.getSystemPath(path);
assertEquals("/work/" + DIRECTORY_NAME, stringPath); assertEquals("/work/" + DIRECTORY_NAME, stringPath);
} }
private Path getPathToFile(FileSystem fileSystem) throws Exception { private Path getPathToFile(final FileSystem fileSystem) throws Exception {
Path path = fileSystem.getPath(DIRECTORY_NAME); final Path path = fileSystem.getPath(DIRECTORY_NAME);
Files.createDirectory(path); Files.createDirectory(path);
return path; return path;