File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/test/scala/lerna/akka/entityreplication/raft/snapshot Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,24 @@ class ShardSnapshotStoreSuccessSpec
4848 expectMsg(SaveSnapshotSuccess (metadata))
4949 }
5050
51+ " persist nothing and reply with SaveSnapshotSuccess to SaveSnapshot if it has the same EntitySnapshot" in {
52+ val entityId = generateUniqueEntityId()
53+ val shardSnapshotStore = createShardSnapshotStore()
54+ val snapshotStorePersistenceId = SnapshotStore .persistenceId(typeName, entityId, memberIndex)
55+ val metadata = EntitySnapshotMetadata (entityId, LogEntryIndex .initial())
56+ val snapshot = EntitySnapshot (metadata, dummyEntityState)
57+
58+ // Prepare:
59+ shardSnapshotStore ! SaveSnapshot (snapshot, replyTo = testActor)
60+ snapshotTestKit.expectNextPersisted(snapshotStorePersistenceId, snapshot)
61+ expectMsg(SaveSnapshotSuccess (metadata))
62+
63+ // Test:
64+ shardSnapshotStore ! SaveSnapshot (snapshot, replyTo = testActor)
65+ snapshotTestKit.expectNothingPersisted(snapshotStorePersistenceId)
66+ expectMsg(SaveSnapshotSuccess (metadata))
67+ }
68+
5169 " FetchSnapshot に成功した場合は一度停止しても SnapshotFound でスナップショットが返信される" in {
5270 val entityId = generateUniqueEntityId()
5371 val shardSnapshotStore = createShardSnapshotStore()
You can’t perform that action at this time.
0 commit comments