Skip to content

play deprecations #60

@pawelpanasewicz

Description

@pawelpanasewicz

WSRequest.scala:44 (and possible other code) relies on deprecations in play.

As a result it's not possible to run parts of the code without running Play Appliacion. Isolation and Encapsulation is broken.

Example. Below code throws Exception in thread "main" java.lang.RuntimeException: There is no started application

object Demo extends App {
  val ws = new uk.gov.hmrc.play.http.ws.WSHttp {
    override val hooks: Seq[HttpHook] = Nil
  }
  implicit val hc = HeaderCarrier()

  ws.GET[HttpResponse]("https://google.com") //BOOM
}
Exception in thread "main" java.lang.RuntimeException: There is no started application
	at scala.sys.package$.error(package.scala:27)
	at play.api.Play$$anonfun$current$1.apply(Play.scala:86)
	at play.api.Play$$anonfun$current$1.apply(Play.scala:86)
	at scala.Option.getOrElse(Option.scala:121)
	at play.api.Play$.current(Play.scala:86)
	at uk.gov.hmrc.play.http.ws.WSRequest$class.buildRequest(WSRequest.scala:44)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions