Provide a AKKA TestKit like for Protoactor.
package testkit
import (
"testing"
"github.com/AsynkronIT/protoactor-go/actor"
"github.com/stretchr/testify/assert"
)
func helloActorProps() *actor.Props {
return actor.FromFunc(func(context actor.Context) {
switch context.Message() {
case hello:
context.Respond("world")
}
})
}
func TestTestProbeReceiveMsg(t *testing.T) {
helloActor := actor.Spawn(helloActorProps())
tp := NewTestProbe(t)
tp.Request(helloActor, "hello")
tp.ExpectMsg("world")
tp.ExpectNoMsg()
tp.StopGraceful()
}