pjfanning commented on code in PR #156: URL: https://github.com/apache/incubator-pekko-persistence-jdbc/pull/156#discussion_r1530459914
########## core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/JdbcDurableStateSpec.scala: ########## @@ -113,6 +113,45 @@ abstract class JdbcDurableStateSpec(config: Config, schemaType: SchemaType) exte } } } + "delete old object revision but not latest" in { + whenReady { + for { + + n <- stateStoreString.upsertObject("p987", 1, "a valid string", "t123") + _ = n shouldBe pekko.Done + g <- stateStoreString.getObject("p987") + _ = g.value shouldBe Some("a valid string") + u <- stateStoreString.upsertObject("p987", 2, "updated valid string", "t123") + _ = u shouldBe pekko.Done + d <- stateStoreString.deleteObject("p987", 1) + _ = d shouldBe pekko.Done + h <- stateStoreString.getObject("p987") + + } yield h + } { v => + v.value shouldBe Some("updated valid string") + } + } + "delete latest object revision but not older one" in { + whenReady { + for { + + n <- stateStoreString.upsertObject("p9876", 1, "a valid string", "t123") + _ = n shouldBe pekko.Done + g <- stateStoreString.getObject("p9876") + _ = g.value shouldBe Some("a valid string") + u <- stateStoreString.upsertObject("p9876", 2, "updated valid string", "t123") + _ = u shouldBe pekko.Done + d <- stateStoreString.deleteObject("p9876", 2) + _ = d shouldBe pekko.Done + h <- stateStoreString.getObject("p9876") + + } yield h + } { v => + // TODO current behavior is that deleting the latest revision means getObject returns None (not an older revision) + v.value shouldBe None Review Comment: @mdedetrich @Roiocam I don't want to off in the wrong direction. Could you review the existing changes and check out my preliminary analysis of why this test doesn't work as I would expect it to? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For additional commands, e-mail: notifications-h...@pekko.apache.org