I am unit-testing an actor that uses the Cluster tool DistributedPubSub
. For the tests I am using the TestKit of Akka.net.
Apparently, in the TestKit, the system actor Sys
doesn't have the DistributedPubSub
tool and it throws a Null pointer exception when accessing it.
This is the code failing when the actor is created as child of Sys:
var mediador = DistributedPubSub.Get(Context.System).Mediator;
Is there a way to mock it or create an actor probe to use it with Sys
?