akka / akka-http

The Streaming-first HTTP server/module of Akka
https://doc.akka.io/docs/akka-http
Other
1.34k stars 594 forks source link

TestKit compatibility #1532

Open ykycxzsv opened 6 years ago

ykycxzsv commented 6 years ago

It seems like ScalatestRouteTest is incompatible with akka's TestKit, since they both implement val system: ActorSystem. I can't override it either, because it gets initialized too late and results in a NullPointerException. Is there a way to write tests that use both actors and HTTP?

jrudolph commented 6 years ago

Hi @ykycxzsv, thanks for the report. Can you try if overriding with override lazy val system would work? Otherwise, you should still be able to test actors even without extending from Akka's TestKit. What features of Akka's Testkit are you missing?

ykycxzsv commented 6 years ago

The compiler says "lazy value system cannot override a concrete non-lazy value". It's not about specific features, but our entire internal test framework sits on top of TestKit, so it's not trivial to get rid of it.