From 5f24d80f3d64445097239639ca17f909f09498b0 Mon Sep 17 00:00:00 2001 From: tienvn Date: Mon, 10 Jul 2023 22:42:12 +0700 Subject: [PATCH] edit unit test --- .../RelativePathConverterUnitTest.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core-java-modules/core-java-20/src/test/java/com/baeldung/convertpaths/RelativePathConverterUnitTest.java b/core-java-modules/core-java-20/src/test/java/com/baeldung/convertpaths/RelativePathConverterUnitTest.java index 1573611697..80f61d45c9 100644 --- a/core-java-modules/core-java-20/src/test/java/com/baeldung/convertpaths/RelativePathConverterUnitTest.java +++ b/core-java-modules/core-java-20/src/test/java/com/baeldung/convertpaths/RelativePathConverterUnitTest.java @@ -5,40 +5,45 @@ import org.junit.Test; public class RelativePathConverterUnitTest { @Test - public void testConvertToAbsolutePath() { + public void givenRelativePath_whenConvertingToAbsolutePath_thenPrintOutput() { String relativePath = "data/sample.txt"; + System.out.println(RelativePathConverter.convertToAbsoluteUsePathsClass(relativePath)); System.out.println(RelativePathConverter.convertToAbsoluteUseFileClass(relativePath)); System.out.println(RelativePathConverter.convertToAbsoluteUseFileSystemsClass(relativePath)); } @Test - public void testConvertToAbsolutePath_withAbsolutePath() { + public void givenAbsolutePath_whenConvertingToAbsolutePath_thenPrintOutput() { String absolutePath = "/var/www/index.html"; + System.out.println(RelativePathConverter.convertToAbsoluteUsePathsClass(absolutePath)); System.out.println(RelativePathConverter.convertToAbsoluteUseFileClass(absolutePath)); System.out.println(RelativePathConverter.convertToAbsoluteUseFileSystemsClass(absolutePath)); } @Test - public void testConvertToAbsolutePath_withEmptyPath() { + public void givenEmptyPath_whenConvertingToAbsolutePath_thenPrintOutput() { String emptyPath = ""; + System.out.println(RelativePathConverter.convertToAbsoluteUsePathsClass(emptyPath)); System.out.println(RelativePathConverter.convertToAbsoluteUseFileClass(emptyPath)); System.out.println(RelativePathConverter.convertToAbsoluteUseFileSystemsClass(emptyPath)); } @Test - public void testConvertToAbsolutePath_withParentDirectory() { + public void givenParentDirectoryPath_whenConvertingToAbsolutePath_thenPrintOutput() { String relativePath = "../data/sample.txt"; + System.out.println(RelativePathConverter.convertToAbsoluteUsePathsClass(relativePath)); System.out.println(RelativePathConverter.convertToAbsoluteUseFileClass(relativePath)); System.out.println(RelativePathConverter.convertToAbsoluteUseFileSystemsClass(relativePath)); } @Test - public void testConvertToAbsolutePath_withRelativePathContainingDots() { + public void givenRelativePathContainingDots_whenConvertingToAbsolutePath_thenPrintOutput() { String relativePath = "././data/sample.txt"; + System.out.println(RelativePathConverter.convertToAbsoluteUsePathsClass(relativePath)); System.out.println(RelativePathConverter.convertToAbsoluteUseFileClass(relativePath)); System.out.println(RelativePathConverter.convertToAbsoluteUseFileSystemsClass(relativePath));