Closed xuwei-k closed 1 year ago
Thanks, will take a look later. This port thing needs a bit more attention from my side, I don't want to blindly merge this.
The problem you solve here is now solved by Play itself already by disabling the https port by default. Please check out https://github.com/xuwei-k/playframework-jdk-20/pull/1 where I fixed your example, it's working now.
Anyway, I adjusted this pull request, so devs are still able to override the TestFactory, it might help in other situations.
playframework
DefaultTestServerFactory
setsslPort = Some(0)
by default.https://github.com/playframework/playframework/blob/bf0458232c1f0c98e06c2cba48f1cffca0e7df43/testkit/play-test/src/main/scala/play/api/test/TestServerFactory.scala#L64
but
enable ssl
andSelfSignedSSLEngineProvider
causeIllegalAccessError
orNoSuchMethodError
https://github.com/playframework/playframework/blob/bf0458232c1f0c98e06c2cba48f1cffca0e7df43/testkit/play-test/src/main/scala/play/api/test/TestServerFactory.scala#L69
I think
scalatestplus-play
should provide more convenience way for override enable/disable ssl settings.