ScalaWS in play framework 2.5 and dependency injection of WSClient in custom class
<p>I'm using Scala Play framework 2.5 and I would like to use dependency injection to inject an instance of WSClient into my custom class but I keep getting the following error.</p>

<pre><code>not enough arguments for constructor TestClass: (ws: play.api.libs.ws.WSClient)service.TestClass. Unspecified value parameter ws.
</code></pre>

<p>I get the error when running the following code</p>

<pre><code>class TestClass @Inject() (ws: WSClient) {
  def doSomething() : Future[WSResponse] = {
    ws.url("http://www.google.com").get()
  }
}

val test = new TestClass()
val f = test.doSomething()
val result = Await.result(f, Duration.Inf)

println("doSomething: " + result)
</code></pre>

<p>Can someone help me resolve this problem of trying to inject a wsclient dependency into a custom class?</p>

<p>Thanking you in advance</p>

<p>Francis</p>