summaryrefslogtreecommitdiff
path: root/src/test/java/com/keuin/kbackupfabric
diff options
context:
space:
mode:
authorKeuin <[email protected]>2021-01-13 12:51:15 +0800
committerkeuin <[email protected]>2021-01-13 12:51:15 +0800
commit81497ebee2cdb0dac3bcdc26c5d77d06bdb98b5d (patch)
tree9e7aad680a438b845126b266374155c8fb306179 /src/test/java/com/keuin/kbackupfabric
parentf4d926c1eb91749a4b0f89c7a35538821ff7e21b (diff)
Clean old incremental backup codes.
Diffstat (limited to 'src/test/java/com/keuin/kbackupfabric')
-rw-r--r--src/test/java/com/keuin/kbackupfabric/util/backup/name/PrimitiveBackupFileNameEncoderTest.java21
1 files changed, 21 insertions, 0 deletions
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