(test) Fix broken test
This commit is contained in:
parent
91c7960800
commit
c5760cd535
@ -33,6 +33,14 @@ class DomainRankingSetsServiceTest {
|
||||
dataSource = new HikariDataSource(config);
|
||||
|
||||
TestMigrationLoader.flywayMigration(dataSource);
|
||||
|
||||
// The migration SQL will insert a few default values, we want to remove them
|
||||
wipeDomainRankingSets(dataSource);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
wipeDomainRankingSets(dataSource);
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
@ -45,10 +53,6 @@ class DomainRankingSetsServiceTest {
|
||||
public void testScenarios() throws Exception {
|
||||
var service = new DomainRankingSetsService(dataSource);
|
||||
|
||||
// Clean up default values
|
||||
service.get("BLOGS").ifPresent(service::delete);
|
||||
service.get("NONE").ifPresent(service::delete);
|
||||
|
||||
var newValue = new DomainRankingSetsService.DomainRankingSet(
|
||||
"test",
|
||||
"Test domain set",
|
||||
@ -81,4 +85,9 @@ class DomainRankingSetsServiceTest {
|
||||
allValues = service.getAll();
|
||||
assertEquals(0, allValues.size());
|
||||
}
|
||||
|
||||
private static void wipeDomainRankingSets(HikariDataSource dataSource) {
|
||||
var service = new DomainRankingSetsService(dataSource);
|
||||
service.getAll().forEach(service::delete);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user