How to use `BehaviorTestKit` for a typed actor which creates an `ActorMaterializer`?


Behaviors.setup { context =>
  implicit val mat: Materializer    = ActorMaterializer()(context.system)

Don’t say “not at all” ;-)

I guess it fails already when creating the materializer (system.systemActorOf). We should probably have a clear error message for such things that are not supported by BehaviorTestKit.

It’s only a narrow set of tests that can be written with BehaviorTestKit. See them as unit tests of Behaviors. As with all unit tests some things must be stubbed instead of the real thing.

Yeah, but for stubbing/mocking these things need to be interfaces: for Materializer that works easily, but not for the extensions like CoordinatedShutdown, Http, etc. See my other questions, tickets …

I have started a PR to support extensions and stubbing/mocking of those in BehaviorTestKit: