File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
main/scala/lerna/akka/entityreplication/raft/snapshot
test/scala/lerna/akka/entityreplication/raft/snapshot Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -96,8 +96,11 @@ private[entityreplication] class SnapshotStore(
9696 cmd.entityId,
9797 )
9898 case FetchSnapshot (_, replyTo) =>
99- prevSnapshot.foreach { s =>
100- replyTo ! SnapshotProtocol .SnapshotFound (s)
99+ prevSnapshot match {
100+ case Some (prevSnapshot) =>
101+ replyTo ! SnapshotProtocol .SnapshotFound (prevSnapshot)
102+ case None =>
103+ replyTo ! SnapshotProtocol .SnapshotNotFound (entityId)
101104 }
102105 }
103106 case _ : persistence.SaveSnapshotSuccess =>
Original file line number Diff line number Diff line change @@ -109,7 +109,6 @@ class ShardSnapshotStoreFailureSpec
109109 }
110110
111111 " reply with `SnapshotNotFound` to `FetchSnapshot` if it has no EntitySnapshot and is saving an EntitySnapshot" in {
112- // TODO Change SnapshotStore.savingSnapshot such that this test passes.
113112 val entityId = generateUniqueEntityId()
114113 val shardSnapshotStore = createShardSnapshotStore()
115114 val metadata = EntitySnapshotMetadata (entityId, LogEntryIndex (1 ))
@@ -123,7 +122,7 @@ class ShardSnapshotStoreFailureSpec
123122
124123 // Test:
125124 shardSnapshotStore ! FetchSnapshot (entityId, replyTo = testActor)
126- expectMsg(SnapshotNotFound )
125+ expectMsg(SnapshotNotFound (entityId) )
127126 } finally {
128127 // Cleanup:
129128 // The succeeding tests will fail unless the promise is fulfilled.
You can’t perform that action at this time.
0 commit comments