playframework icon indicating copy to clipboard operation
playframework copied to clipboard

Improve getTestServerIfRunning

Open tanin47 opened this issue 2 years ago • 0 comments

Pull Request Checklist

  • [x] Have you read How to write the perfect pull request?
  • [x] Have you read through the contributor guidelines?
  • [x] Have you referenced any issues you're fixing using commit message keywords?
  • [x] Have you added copyright headers to new files?
  • [x] Have you checked that both Scala and Java APIs are updated?
  • [x] Have you updated the documentation for both Scala and Java sections?
  • [x] Have you added tests for any changed functionality?

Helpful things

Fixes

Fixes https://github.com/playframework/playframework/issues/12331

Purpose

Improve the interface of TestServer. Currently, if a TestServer doesn't exist, a few functions raise an exception.

Those functions should have return None (e.g. def runningHttpPort: Option[Int]) or false (e.g. def isRunning: Boolean) instead of raising an exception.

tanin47 avatar Feb 03 '24 19:02 tanin47