this.serverFileSystem = serverFileSystem;
}
- public byte[] createDatabaseForDryRun(Integer resourceId) {
+ public byte[] createDatabaseForDryRun() {
String name = serverFileSystem.getTempDir().getAbsolutePath() + "db-" + System.nanoTime();
try {
DataSource source = database.getDataSource();
BasicDataSource destination = create(DIALECT, DRIVER, USER, PASSWORD, URL + name);
- copy(source, destination, resourceId);
+ copy(source, destination);
close(destination);
return dbFileContent(name);
}
}
- private void copy(DataSource source, DataSource dest, Integer resourceId) {
+ private void copy(DataSource source, DataSource dest) {
new DbTemplate()
.copyTable(source, dest, "active_rules")
.copyTable(source, dest, "active_rule_parameters")
when(serverFileSystem.getTempDir()).thenReturn(temporaryFolder.getRoot());
- byte[] database = localDatabaseFactory.createDatabaseForDryRun(1);
+ byte[] database = localDatabaseFactory.createDatabaseForDryRun();
dataSource = createDatabase(database);
assertThat(rowCount("metrics")).isEqualTo(2);
}
}
- public byte[] createDatabaseForDryRun(int resourceId) {
- return get(DryRunDatabaseFactory.class).createDatabaseForDryRun(resourceId);
+ public byte[] createDatabaseForDryRun() {
+ return get(DryRunDatabaseFactory.class).createDatabaseForDryRun();
}
}