Skip to content

Commit

Permalink
Merge pull request #105 from naver/feature/add-test-data
Browse files Browse the repository at this point in the history
Add test data set

Reviewed-by: @taeyeon-Kim @kojandy
  • Loading branch information
sohyun-ku authored Nov 23, 2023
2 parents 6dacf43 + 9f26a57 commit e2ae6d8
Show file tree
Hide file tree
Showing 4 changed files with 213 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ApplicationRepositoryTest {

@Test
fun findAllByCustomerId() {
assertThat(sut.findAllByCustomerId(1)).hasSize(1)
assertThat(sut.findAllByCustomerId(1)).hasSize(2)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,22 +197,22 @@ class GarbageCollectServiceTest {
sut.sweepMethods(customerId, min!!)
assertThat(methodDao.findAllByCustomerId(customerId))
.describedAs("nothing is deleted when the 1 week is not passed since last seen")
.hasSize(5)
.hasSize(34)
assertThat(invocationDao.findAllByCustomerId(customerId))
.describedAs("invocations should be same as before")
.hasSize(invocations.size)
sut.sweepMethods(customerId, min!!.plusSeconds(10))
assertThat(methodDao.findAllByCustomerId(customerId))
.describedAs("marked method is deleted when the more than 1 week is passed after last seen")
.hasSize(3)
.hasSize(32)
val invocationsAfter = invocationDao.findAllByCustomerId(customerId)
assertThat(invocationsAfter)
.describedAs("invocations should be deleted as well")
.hasSizeLessThan(invocations.size)
sut.sweepMethods(customerId, Instant.now())
assertThat(methodDao.findAllByCustomerId(customerId))
.describedAs("nothing more is deleted when no marking is done")
.hasSize(3)
.hasSize(32)
}

@Test
Expand All @@ -225,22 +225,22 @@ class GarbageCollectServiceTest {
sut.sweepMethods(customerId, min!!)
assertThat(methodDao.findAllByCustomerId(customerId))
.describedAs("nothing is deleted when the 1 week is not passed since last seen")
.hasSize(5)
.hasSize(34)
assertThat(invocationDao.findAllByCustomerId(customerId))
.describedAs("invocations should be same as before")
.hasSize(invocations.size)
sut.sweepMethods(customerId, min!!.plusSeconds(10))
assertThat(methodDao.findAllByCustomerId(customerId))
.describedAs("marked method is deleted when the more than 1 week is passed after last seen")
.hasSize(3)
.hasSize(32)
val invocationsAfter = invocationDao.findAllByCustomerId(customerId)
assertThat(invocationsAfter)
.describedAs("invocations should be deleted as well")
.hasSizeLessThan(invocations.size)
sut.sweepMethods(customerId, Instant.now())
assertThat(methodDao.findAllByCustomerId(customerId))
.describedAs("nothing more is deleted when no marking is done")
.hasSize(3)
.hasSize(32)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ databaseChangeLog:
- include:
file: db/changelog/test-data-set.sql
context: local
- include:
file: db/changelog/test-data-set-1.1.2.sql
context: local
Loading

0 comments on commit e2ae6d8

Please sign in to comment.