// Setup
Config testConfig = TestConfigUtil.createTestLocalConfig();
Connection databaseConnection = testConfig.createDatabaseConnection();
// Run
ApplicationSqlDao applicationDao = new ApplicationSqlDao(databaseConnection);
List<DatabaseRemoteFile> expectedKnownDatabases = Arrays.asList(new DatabaseRemoteFile[] {
new DatabaseRemoteFile("database-A-0000000001"),
new DatabaseRemoteFile("database-V-0000000001"),
new DatabaseRemoteFile("database-B-0000000001"),
new DatabaseRemoteFile("database-A-0000000002")
});
applicationDao.writeKnownRemoteDatabases(expectedKnownDatabases);
List<DatabaseRemoteFile> actualKnownDatabases = applicationDao.getKnownDatabases();
// Test
assertTrue(CollectionUtil.containsExactly(expectedKnownDatabases, actualKnownDatabases));
// Tear down