mirror of https://github.com/micromata/borgbackup-butler.git

Kai Reinhard
19.29.2022 9926a79503c9bd6454c076f2b60cd577f6061e4d
borgbutler-server/src/test/java/de/micromata/borgbutler/server/BorgInstallationTest.java
@@ -21,9 +21,24 @@
        borgInstallation.initialize();
    }
    @Test
    void configureTest() {
        ConfigurationHandler.setConfigClazz(ServerConfiguration.class);
        BorgInstallation borgInstallation = BorgInstallation.getInstance();
        borgInstallation.initialize();
        BorgConfig borgConfig = new BorgConfig();
        borgConfig.setVersion("1.1.15");
        borgConfig.setBorgBinary("freebsd64");
        ServerConfiguration serverConfig = ServerConfiguration.get();
        borgInstallation.configure(serverConfig, borgConfig);
        String expected = "freebsd64-1.1.15";
        assertTrue(serverConfig.getBorgCommand().endsWith(expected), "String '" + serverConfig.getBorgCommand() + "' should end with '" + expected + "'.");
    }
    @Test
    void downloadTest() {
        String version = new BorgVersion().getBinariesDownloadVersion();
        String version = new BorgConfig().getVersion();
        checkDownload(RunningMode.OSType.LINUX, "borg-linux64-" + version);
        checkDownload(RunningMode.OSType.MAC_OS, "borg-macosx64-" + version);
        checkDownload(RunningMode.OSType.FREEBSD, "borg-freebsd64-" + version);