diff options
Diffstat (limited to 'src/test/java/com')
-rw-r--r-- | src/test/java/com/keuin/kbackupfabric/config/KBackupConfigTest.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/java/com/keuin/kbackupfabric/config/KBackupConfigTest.java b/src/test/java/com/keuin/kbackupfabric/config/KBackupConfigTest.java new file mode 100644 index 0000000..811156a --- /dev/null +++ b/src/test/java/com/keuin/kbackupfabric/config/KBackupConfigTest.java @@ -0,0 +1,29 @@ +package com.keuin.kbackupfabric.config; + +import com.keuin.kbackupfabric.TestUtils; +import org.junit.Test; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; + +public class KBackupConfigTest { + + @Test + public void load() throws Exception { + String tempDir = TestUtils.getTempDirectory("config_test"); + Files.createDirectories(Paths.get(tempDir)); + Path configPath = Paths.get(tempDir, "test_config.json"); + Files.write( + configPath, + "{\n//comment\n}".getBytes(StandardCharsets.UTF_8), + StandardOpenOption.CREATE, + StandardOpenOption.WRITE, + StandardOpenOption.TRUNCATE_EXISTING + ); + System.out.println(configPath.toFile().getAbsolutePath()); + KBackupConfig.load(configPath.toFile()); + } +}
\ No newline at end of file |