-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from lerna-stack/notify-replication-failure-t…
…o-conflict-clients Notify replication failure to conflict clients
- Loading branch information
Showing
8 changed files
with
274 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/test/scala/lerna/akka/entityreplication/raft/model/ClientContextSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package lerna.akka.entityreplication.raft.model | ||
|
||
import akka.actor.ActorSystem | ||
import akka.testkit.{ TestKit, TestProbe } | ||
import lerna.akka.entityreplication.raft.ActorSpec | ||
|
||
final class ClientContextSpec extends TestKit(ActorSystem("ClientContextSpec")) with ActorSpec { | ||
|
||
"ClientContext.forward should send the given message to the actor, including no sender, if the context doesn't have an original sender" in { | ||
val probe = TestProbe() | ||
val clientContext = ClientContext(probe.ref, instanceId = None, originSender = None) | ||
clientContext.forward("message-1") | ||
probe.expectMsg("message-1") | ||
probe.sender() should be(system.deadLetters) | ||
} | ||
|
||
"ClientContext.forward should send the given message to the actor, including an original sender, if the context has the original sender" in { | ||
val probe = TestProbe() | ||
val originalSender = TestProbe().ref | ||
val clientContext = ClientContext(probe.ref, instanceId = None, originSender = Some(originalSender)) | ||
clientContext.forward("message-1") | ||
probe.expectMsg("message-1") | ||
probe.sender() should be(originalSender) | ||
} | ||
|
||
} |