play-mockws icon indicating copy to clipboard operation
play-mockws copied to clipboard

added standalone client instead of the play 2.8 specific client.

Open conorml opened this issue 4 years ago • 2 comments

Wanted to get your thoughts on this. As of play 2.6 the standalone client is separated from play. So it would be nice to have this mocking library dependent as much as possible on the standalone client.

The one problem is that it does still require a play dependency to make everyting work. Though it's only play-test and it seem like most the things being used from play-test have been pretty stable, but I'm not sure theres a way to remove the play dependency entirely to only have a dependency on standalone play client.

conorml avatar Feb 07 '22 20:02 conorml

@avdv thoughts?

conorml avatar Mar 09 '22 20:03 conorml

I haven't looked at this in the details but:

  • Play's WSRequest extends Play Standalone StandaloneWSRequest and enriches it,
  • same for the responses classes
  • Play's WSClient does not extend Play Standalone StandaloneWSClient, it composes it class AhcWSClient(underlyingClient: StandaloneAhcWSClient) extends WSClient

Because of this, people's code depending on Play's WSClient wouldn't work as-is if given a StandaloneWSClient, they'd need to wrap it manually in a AhcWSClient.

That said, we could provide two modules: one for the standalone client, and one for Play's full framework. The latter would depend on the former and do the wrapping so that users don't have to do it themselves.

I will give it more thought.

Would this still be of use for you @conorml ?

gaeljw avatar Nov 19 '23 16:11 gaeljw