Skip to content

Commit

Permalink
Clarify confusing variable names in test
Browse files Browse the repository at this point in the history
Co-Authored-By: Paul Butcher <[email protected]>
  • Loading branch information
kenoir and Paul Butcher committed Sep 18, 2024
1 parent 39586a2 commit 2f40296
Showing 1 changed file with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,17 @@ class MergerWorkerServiceTest
}
}

it("send versions of a Work even if they are not the latest") {
it("sends a Work even if the matched version is not the latest") {
withMergerWorkerServiceFixtures {
case (retriever, QueuePair(queue, dlq), senders, _, index) =>
val work = identifiedWork()
val olderWork = identifiedWork()
val newerWork =
identifiedWork(canonicalId = olderWork.state.canonicalId)
.withVersion(olderWork.version + 1)

val matcherResult = createMatcherResultWith(Set(Set(work, olderWork)))
val workA = identifiedWork()
val workB = identifiedWork()
val newerWorkB =
identifiedWork(canonicalId = workB.state.canonicalId)
.withVersion(workB.version + 1)
val matcherResult = createMatcherResultWith(Set(Set(workA, workB)))

retriever.index ++= Map(work.id -> work, newerWork.id -> newerWork)
retriever.index ++= Map(workA.id -> workA, workB.id -> newerWorkB)

sendNotificationToSQS(
queue = queue,
Expand All @@ -158,11 +157,13 @@ class MergerWorkerServiceTest
eventually {
assertQueueEmpty(queue)
assertQueueEmpty(dlq)
getWorksSent(senders) should contain allOf (work.id, olderWork.id)
getWorksSent(senders) should contain allOf (workA.id, workB.id)
index shouldBe Map(
work.id -> Left(work.transition[Merged](matcherResult.createdTime)),
newerWork.id -> Left(
newerWork.transition[Merged](matcherResult.createdTime)
workA.id -> Left(
workA.transition[Merged](matcherResult.createdTime)
),
workB.id -> Left(
newerWorkB.transition[Merged](matcherResult.createdTime)
)
)
}
Expand Down

0 comments on commit 2f40296

Please sign in to comment.