[ BAEL-3322 ] : Fix test name
This commit is contained in:
@@ -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;
|
||||||
Reference in New Issue
Block a user