Skip to content

Commit

Permalink
fix(sql): Test pollution (#4928)
Browse files Browse the repository at this point in the history
  • Loading branch information
robzienert committed Sep 23, 2020
1 parent 88bae18 commit b1f4bc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Expand Up @@ -58,16 +58,16 @@ class SqlEventCleanupAgentTest : JUnit5Minutests {
}
}

after {
SqlTestUtil.cleanupDb(database.context)
}

test("deletes old aggregates") {
subject.run()

val count = database.context.fetchCount(DSL.table("event_aggregates"))
expectThat(count).isEqualTo(1)
}

after {
database.context.truncate("event_aggregates")
}
}

private inner class Fixture {
Expand Down
Expand Up @@ -49,6 +49,10 @@ class SqlEventRepositoryTest : JUnit5Minutests {
Fixture()
}

after {
SqlTestUtil.cleanupDb(database.context)
}

context("event lifecycle") {
test("events can be saved") {
subject.save("agg", "1", 0, listOf(MyEvent("one")))
Expand Down Expand Up @@ -209,7 +213,6 @@ class SqlEventRepositoryTest : JUnit5Minutests {

init {
every { serviceVersion.resolve() } returns "v1.2.3"
SqlTestUtil.cleanupDb(database.context)
}
}

Expand Down

0 comments on commit b1f4bc1

Please sign in to comment.