-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Play 2.9 & Scala 3 #321
Play 2.9 & Scala 3 #321
Changes from all commits
3ec5465
30bd499
065b392
8ab975f
b15787a
d33b5a4
92c097e
7fa11d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
sbt.version = 1.9.3 | ||
sbt.version = 1.9.7 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,10 +26,10 @@ class AuthenticationTest extends AnyFunSuite with Matchers with ScalaCheckProper | |
} | ||
} | ||
|
||
val wsResponseOk = await(ws.url("/").withAuth("user", "s3cr3t", WSAuthScheme.BASIC).get) | ||
val wsResponseOk = await(ws.url("/").withAuth("user", "s3cr3t", WSAuthScheme.BASIC).get()) | ||
wsResponseOk.status shouldEqual OK | ||
|
||
val wsResponseUnauthorized = await(ws.url("/").withAuth("user", "secret", WSAuthScheme.BASIC).get) | ||
val wsResponseUnauthorized = await(ws.url("/").withAuth("user", "secret", WSAuthScheme.BASIC).get()) | ||
wsResponseUnauthorized.status shouldEqual UNAUTHORIZED | ||
|
||
ws.close() | ||
|
@@ -45,16 +45,16 @@ class AuthenticationTest extends AnyFunSuite with Matchers with ScalaCheckProper | |
} | ||
|
||
a[UnsupportedOperationException] shouldBe thrownBy( | ||
await(ws.url("/").withAuth("user", "s3cr3t", WSAuthScheme.NTLM).get) | ||
await(ws.url("/").withAuth("user", "s3cr3t", WSAuthScheme.NTLM).get()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Functions must be called using parenthesis in Scala now |
||
) | ||
a[UnsupportedOperationException] shouldBe thrownBy( | ||
await(ws.url("/").withAuth("user", "s3cr3t", WSAuthScheme.DIGEST).get) | ||
await(ws.url("/").withAuth("user", "s3cr3t", WSAuthScheme.DIGEST).get()) | ||
) | ||
a[UnsupportedOperationException] shouldBe thrownBy( | ||
await(ws.url("/").withAuth("user", "s3cr3t", WSAuthScheme.KERBEROS).get) | ||
await(ws.url("/").withAuth("user", "s3cr3t", WSAuthScheme.KERBEROS).get()) | ||
) | ||
a[UnsupportedOperationException] shouldBe thrownBy( | ||
await(ws.url("/").withAuth("user", "s3cr3t", WSAuthScheme.SPNEGO).get) | ||
await(ws.url("/").withAuth("user", "s3cr3t", WSAuthScheme.SPNEGO).get()) | ||
) | ||
|
||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,9 @@ import scala.concurrent.Future | |
import scala.concurrent.duration._ | ||
import org.scalatest.funsuite.AnyFunSuite | ||
import org.scalatest.matchers.should.Matchers | ||
import play.api.libs.ws.writeableOf_String | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are implicit BodyParser implementations for reading and writting Strings to request bodies. They now need to be imported explicitly in Scala 3 (I think? Scala 3 compilation wouldn't work unless I did). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had the same "issue" in my projects, not sure if that's really intended though. |
||
import play.api.libs.ws.readableAsString | ||
import play.api.libs.ws.writeableOf_JsValue | ||
|
||
/** | ||
* Tests that [[MockWS]] simulates a WS client | ||
|
@@ -180,7 +183,7 @@ class MockWSTest extends AnyFunSuite with Matchers with ScalaCheckPropertyChecks | |
} | ||
} | ||
|
||
val wsResponse = await(ws.url("/").addHttpHeaders(CONTENT_TYPE -> "hello/world").get) | ||
val wsResponse = await(ws.url("/").addHttpHeaders(CONTENT_TYPE -> "hello/world").get()) | ||
wsResponse.status shouldEqual OK | ||
wsResponse.body shouldEqual "hello/world" | ||
ws.close() | ||
|
@@ -198,7 +201,7 @@ class MockWSTest extends AnyFunSuite with Matchers with ScalaCheckPropertyChecks | |
} | ||
} | ||
|
||
val wsResponse = await(ws.url("/uri").addQueryStringParameters(q -> v).get) | ||
val wsResponse = await(ws.url("/uri").addQueryStringParameters(q -> v).get()) | ||
wsResponse.status shouldEqual OK | ||
wsResponse.body shouldEqual v | ||
ws.close() | ||
|
@@ -218,8 +221,8 @@ class MockWSTest extends AnyFunSuite with Matchers with ScalaCheckPropertyChecks | |
} | ||
} | ||
|
||
await(ws.url("/uri").addHttpHeaders(Seq(q -> v): _*).get) | ||
await(ws.url("/uri").addQueryStringParameters(Seq(q -> v): _*).get) | ||
await(ws.url("/uri").addHttpHeaders(Seq(q -> v): _*).get()) | ||
await(ws.url("/uri").addQueryStringParameters(Seq(q -> v): _*).get()) | ||
ws.close() | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
ThisBuild / version := "2.8.2-SNAPSHOT" | ||
ThisBuild / version := "2.9.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 2.13.1? The latest 2.13.x release is 2.13.12
Is this a typo, like everywhere in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2.13.1 was the previously set version of Scala that this project was using, I avoided bumping anything more than I needed to get this project to work with Play 2.9 and Scala 3