@Override
    public void backup(File targetDir, DataSource dataSource, DbProperties dbProperties) throws SQLException {
        try (Connection connection = dataSource.getConnection(); Statement statement = connection.createStatement()) {
            File dbBackupFile = new File(targetDir, "db.zip");
            statement.execute(String.format("BACKUP TO '%s'", dbBackupFile));
        }
    }
@Test
    void shouldTakeBackup(@TempDir Path tempDir) throws SQLException {
        File originalDir = tempDir.resolve("originalDb").toFile();
        originalDir.mkdirs();
        File backupDir = tempDir.resolve("backupDir").toFile();
        backupDir.mkdirs();

        assertThat(backupDir.listFiles()).isNullOrEmpty();
        try (BasicDataSource ds = new BasicDataSource()) {
            ds.setDriverClassName(org.h2.Driver.class.getName());
            ds.setUrl("jdbc:h2:" + new File(originalDir, "test").getAbsoluteFile());
            ds.setUsername("sa");
            ds.setPassword("");

            new H2BackupProcessor().backup(backupDir, ds, null);
        }

        assertThat(backupDir.listFiles()).containsExactly(new File(backupDir, "db.zip"));
    }