Skip to content

Commit

Permalink
verify oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
Roiocam committed May 19, 2024
1 parent 0ca2c46 commit c4e612a
Showing 1 changed file with 0 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,44 +58,6 @@ abstract class JournalMigratorTest(configName: String) extends MigratorSpec(conf
} // new persistence
}

it should "migrate the event journal preserving the order of events" in {
withLegacyActorSystem { implicit systemLegacy =>
withReadJournal { implicit readJournal =>
withTestActors() { (actorA1, actorA2, actorA3) =>
(actorA1 ? CreateAccount(0)).futureValue
(actorA2 ? CreateAccount(0)).futureValue
(actorA3 ? CreateAccount(0)).futureValue
for (i <- 1 to 999) {
(actorA1 ? Deposit(i)).futureValue
(actorA2 ? Deposit(i)).futureValue
(actorA3 ? Deposit(i)).futureValue
}
eventually {
countJournal().futureValue shouldBe 3000
}
}
}
} // legacy persistence
withActorSystem { implicit systemNew =>
withReadJournal { implicit readJournal =>
eventually {
countJournal().futureValue shouldBe 0 // before migration
JournalMigrator(SlickDatabase.profile(config, "slick")).migrate().futureValue shouldBe Done
countJournal().futureValue shouldBe 3000 // after migration
val allEvents: Seq[Seq[AccountEvent]] = events().futureValue
allEvents.size shouldBe 3
val seq1: Seq[Int] = allEvents.head.map(_.amount)
val seq2: Seq[Int] = allEvents(1).map(_.amount)
val seq3: Seq[Int] = allEvents(2).map(_.amount)
val expectedResult: Seq[Int] = 0 to 999
seq1 shouldBe expectedResult
seq2 shouldBe expectedResult
seq3 shouldBe expectedResult
}
}
} // new persistence
}

it should "migrate the event journal preserving tags" in {
withLegacyActorSystem { implicit systemLegacy =>
withReadJournal { implicit readJournal =>
Expand Down

0 comments on commit c4e612a

Please sign in to comment.