The Play 2.5 conductr-bundle-lib uses the new AhcWSClient which got introduced in Play 2.5 This AhcWSClient needs a Materializer in scope. The current implementation is making use of play.api.Play.maybeApplication to get the Materializer from Play's default actor system. An IllegalStateException is thrown if no Play application is in scope.
This implementation should be changed because play.api.Play.maybeApplication has been deprecated and it makes the code harder to test because a fake application needs to be created. The new implementation of the Play 2.5 conductr-client-lib should:
Not provide an implicit defaultContext anymore
Provide an injectable ConnectionContext that uses the materializer from Play's actor system and Play's default execution context
Provide an injectable LocationService and StatusService that uses the default ConnectionContext
The Play 2.5 conductr-bundle-lib uses the new
AhcWSClient
which got introduced in Play 2.5 ThisAhcWSClient
needs a Materializer in scope. The current implementation is making use ofplay.api.Play.maybeApplication
to get the Materializer from Play's default actor system. AnIllegalStateException
is thrown if no Play application is in scope.This implementation should be changed because
play.api.Play.maybeApplication
has been deprecated and it makes the code harder to test because a fake application needs to be created. The new implementation of the Play 2.5 conductr-client-lib should:defaultContext
anymoreConnectionContext
that uses the materializer from Play's actor system and Play's default execution contextLocationService
andStatusService
that uses the defaultConnectionContext