diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/IncrementalBackupUtilTest.java | 16 | ||||
-rw-r--r-- | src/test/java/com/keuin/kbackupfabric/util/backup/name/PrimitiveBackupFileNameEncoderTest.java | 21 |
2 files changed, 21 insertions, 16 deletions
diff --git a/src/test/java/IncrementalBackupUtilTest.java b/src/test/java/IncrementalBackupUtilTest.java deleted file mode 100644 index b050a91..0000000 --- a/src/test/java/IncrementalBackupUtilTest.java +++ /dev/null @@ -1,16 +0,0 @@ -import com.keuin.kbackupfabric.operation.backup.IncrementalBackupUtil; - -import java.io.IOException; - -public class IncrementalBackupUtilTest { - - @org.junit.Test - public void generateDirectoryJsonObject() { - try { - System.out.println(IncrementalBackupUtil.generateDirectoryJsonObject("D:\\1")); - } catch (IOException exception) { - exception.printStackTrace(); - } - - } -}
\ No newline at end of file diff --git a/src/test/java/com/keuin/kbackupfabric/util/backup/name/PrimitiveBackupFileNameEncoderTest.java b/src/test/java/com/keuin/kbackupfabric/util/backup/name/PrimitiveBackupFileNameEncoderTest.java new file mode 100644 index 0000000..4823575 --- /dev/null +++ b/src/test/java/com/keuin/kbackupfabric/util/backup/name/PrimitiveBackupFileNameEncoderTest.java @@ -0,0 +1,21 @@ +package com.keuin.kbackupfabric.util.backup.name; + +import org.junit.Test; + +import java.time.LocalDateTime; +import java.time.ZoneOffset; + +import static org.junit.Assert.assertEquals; + +public class PrimitiveBackupFileNameEncoderTest { + + @Test + public void testConsistency() { + LocalDateTime time = LocalDateTime.ofEpochSecond(System.currentTimeMillis()/1000, 0, ZoneOffset.UTC); + String name = "Test Na_me"; + PrimitiveBackupFileNameEncoder encoder = new PrimitiveBackupFileNameEncoder(); + BackupFileNameEncoder.BackupBasicInformation information = encoder.decode(encoder.encode(name, time)); + assertEquals(time, information.time); + assertEquals(name, information.customName); + } +}
\ No newline at end of file |