Skip to content

Commit

Permalink
add "-Xsource:3" option (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k authored Oct 4, 2023
1 parent b437f4d commit f7d1954
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
8 changes: 8 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ lazy val scalaOAuth2ProviderSettings =
scalaVersion := "3.3.0",
crossScalaVersions ++= Seq("2.13.12", "2.12.18", "2.11.12"),
scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature"),
scalacOptions ++= {
scalaBinaryVersion.value match {
case "2.12" | "2.13" =>
Seq("-Xsource:3")
case _ =>
Nil
}
},
publishTo := {
val v = version.value
val nexus = "https://oss.sonatype.org/"
Expand Down
21 changes: 14 additions & 7 deletions src/test/scala/scalaoauth2/provider/TokenEndPointSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ class TokenEndPointSpec extends AnyFlatSpec with ScalaFutures {

val dataHandler = successfulDataHandler()
val f = new TokenEndpoint {
override val handlers = Map("password" -> new Password())
override val handlers: Map[String, Password] =
Map("password" -> new Password())
}.handleRequest(request, dataHandler)

whenReady(f) { result =>
Expand Down Expand Up @@ -128,7 +129,8 @@ class TokenEndPointSpec extends AnyFlatSpec with ScalaFutures {

val dataHandler = successfulDataHandler()
val f = new TokenEndpoint {
override val handlers = Map("password" -> new Password())
override val handlers: Map[String, Password] =
Map("password" -> new Password())
}.handleRequest(request, dataHandler)

whenReady(f) { result =>
Expand Down Expand Up @@ -159,7 +161,8 @@ class TokenEndPointSpec extends AnyFlatSpec with ScalaFutures {
}

val f = new TokenEndpoint {
override val handlers = Map("password" -> passwordNoCred)
override val handlers: Map[String, Password] =
Map("password" -> passwordNoCred)
}.handleRequest(request, dataHandler)

whenReady(f) { result =>
Expand Down Expand Up @@ -192,7 +195,8 @@ class TokenEndPointSpec extends AnyFlatSpec with ScalaFutures {
}

val f = new TokenEndpoint {
override val handlers = Map("password" -> new Password())
override val handlers: Map[String, Password] =
Map("password" -> new Password())
}.handleRequest(request, dataHandler)

whenReady(f) { result =>
Expand Down Expand Up @@ -249,7 +253,8 @@ class TokenEndPointSpec extends AnyFlatSpec with ScalaFutures {
it should "be possible to customize supporting grant types" in {

object TestTokenEndpoint extends TokenEndpoint {
override val handlers = Map("password" -> new Password())
override val handlers: Map[String, Password] =
Map("password" -> new Password())
}

val f = TestTokenEndpoint.handleRequest(
Expand Down Expand Up @@ -296,7 +301,8 @@ class TokenEndPointSpec extends AnyFlatSpec with ScalaFutures {
}

val f = new TokenEndpoint {
override val handlers = Map("password" -> new Password())
override val handlers: Map[String, Password] =
Map("password" -> new Password())
}.handleRequest(request, dataHandler)

whenReady(f) { result =>
Expand Down Expand Up @@ -335,7 +341,8 @@ class TokenEndPointSpec extends AnyFlatSpec with ScalaFutures {
}

val f = new TokenEndpoint {
override val handlers = Map("password" -> new Password())
override val handlers: Map[String, Password] =
Map("password" -> new Password())
}.handleRequest(request, dataHandler)

whenReady(f) { result =>
Expand Down

0 comments on commit f7d1954

Please sign in to comment.