diff options
author | Keuin <[email protected]> | 2021-01-13 12:51:15 +0800 |
---|---|---|
committer | keuin <[email protected]> | 2021-01-13 12:51:15 +0800 |
commit | 81497ebee2cdb0dac3bcdc26c5d77d06bdb98b5d (patch) | |
tree | 9e7aad680a438b845126b266374155c8fb306179 /src/test/java | |
parent | f4d926c1eb91749a4b0f89c7a35538821ff7e21b (diff) |
Clean old incremental backup codes.
Diffstat (limited to 'src/test/java')
-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 |