From 0807130f74548893e3300457b5be5eb48f312f98 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Wed, 20 Mar 2019 13:51:39 +0100 Subject: [PATCH] remove ??? in SnapshotMutableStateSpec, #26581 * ??? is probably fatal error and therefore the Boxed Error * this test should attempt to delete snasphots, but that is another issue --- .../typed/scaladsl/SnapshotMutableStateSpec.scala | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/SnapshotMutableStateSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/SnapshotMutableStateSpec.scala index 9c85c65ad4..5e4cc6599d 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/SnapshotMutableStateSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/SnapshotMutableStateSpec.scala @@ -52,8 +52,19 @@ object SnapshotMutableStateSpec { } } - def deleteAsync(metadata: UntypedSnapshotMetadata) = ??? - def deleteAsync(persistenceId: String, criteria: UntypedSnapshotSelectionCriteria) = ??? + override def deleteAsync(metadata: UntypedSnapshotMetadata): Future[Unit] = { + state = state.filterNot { + case (pid, (_, meta)) => pid == metadata.persistenceId && meta.sequenceNr == metadata.sequenceNr + } + Future.successful(()) + } + + override def deleteAsync(persistenceId: String, criteria: UntypedSnapshotSelectionCriteria): Future[Unit] = { + state = state.filterNot { + case (pid, (_, meta)) => pid == persistenceId && criteria.matches(meta) + } + Future.successful(()) + } } def conf: Config = ConfigFactory.parseString(s"""