Skip to content

Commit

Permalink
Fix various warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ioannakok committed Aug 9, 2022
1 parent a869ec1 commit 0d1510d
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion identity/app/idapiclient/parser/JsonBodyParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ trait JsonBodyParser extends Logging {
extractJsonObj: JValue => JValue = identity,
)(httpResponseResponse: Response[HttpResponse])(implicit successType: Manifest[T]): Response[T] = {

httpResponseResponse.right.flatMap { httpResponse =>
httpResponseResponse.flatMap { httpResponse =>
try {
httpResponse match {
case HttpResponse(body, status, message) if status == 502 =>
Expand Down
2 changes: 1 addition & 1 deletion identity/app/services/PlaySigninService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PlaySigninService(conf: IdentityConfiguration) extends SafeLogging {
executionContext: ExecutionContext,
): Future[Response[List[Cookie]]] = {
cookiesResponse map {
_.right.map(getCookies(_, rememberMe))
_.map(getCookies(_, rememberMe))
}
}

Expand Down
8 changes: 4 additions & 4 deletions identity/test/idapiclient/IdApiTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ class IdApiTest
)
val cookies = cookiesResponse.values
cookies.size must equal(1)
cookies(0) must have('key ("SC_GU_U"))
cookies(0) must have('value ("testCookieValue"))
cookies(0) must have(Symbol("key")("SC_GU_U"))
cookies(0) must have(Symbol("value")("testCookieValue"))
}
}
}
Expand Down Expand Up @@ -154,8 +154,8 @@ class IdApiTest
whenReady(idApi.user(testUserId)) {
case Left(result) => fail("Got Left(%s), instead of expected Right".format(result.toString()))
case Right(user) => {
user must have('id (testUserId))
user.publicFields must have('username (Some("testUsername")))
user must have(Symbol("id")(testUserId))
user.publicFields must have(Symbol("username")(Some("testUsername")))
user.primaryEmailAddress mustEqual "test@example.com"
}
}
Expand Down
4 changes: 2 additions & 2 deletions identity/test/idapiclient/parser/JsonBodyParserTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class JsonBodyParserTest extends PathAnyFreeSpec with Matchers {
"returns a parse error if the JSON is not valid" in {
TestJsonBodyParser.extract[TestType]()(Right(invalidJSONResponse)) match {
case Right(result) => fail("extractJsonOrError did not return a Left, got %s".format(result.toString))
case Left(errors) => errors(0) should have('message ("JSON parsing exception"))
case Left(errors) => errors(0) should have(Symbol("message")("JSON parsing exception"))
}
}

Expand All @@ -41,7 +41,7 @@ class JsonBodyParserTest extends PathAnyFreeSpec with Matchers {
"extracts the provided type from the JSON body of a successful response" in {
TestJsonBodyParser.extract[TestType]()(Right(validJSONResponse)) match {
case Left(result) => fail("extract did not return a Right, got Left(%s)".format(result.toString()))
case Right(testObject: TestType) => testObject should have('test ("value"))
case Right(testObject: TestType) => testObject should have(Symbol("test")("value"))
case Right(result) =>
fail("extract did not return a Right of the required type, got a %s".format(result.getClass.getName))
}
Expand Down
4 changes: 2 additions & 2 deletions preview/app/views/showcase.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h1>Showcase</h1>
</ul>
</li>
}
@for(panel <- rundownPanelOutcomes.right.toOption) {
@for(panel <- rundownPanelOutcomes.toOption) {
<li class="panel rundown">
<h2 class="panelTitle">@panel.panelTitle</h2>
@showcase_articlegroup(panel.articleGroup)
Expand All @@ -96,7 +96,7 @@ <h2 class="panelTitle">@panel.panelTitle</h2>
</ul>
</li>
}
@for(panel <- panelOutcome.right.toOption) {
@for(panel <- panelOutcome.toOption) {
<li class="panel singleStory">
@for(panelTitle <- panel.panelTitle) {
<h2 class="panelTitle">
Expand Down
2 changes: 1 addition & 1 deletion sport/test/FixturesFeatureTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.scalatest.featurespec.AnyFeatureSpec
import org.scalatest.matchers.should.Matchers
import org.scalatest.{DoNotDiscover, GivenWhenThen}

import collection.JavaConverters._
import scala.jdk.CollectionConverters._
import tools.MatchListFeatureTools

@DoNotDiscover class FixturesFeatureTest
Expand Down
2 changes: 1 addition & 1 deletion sport/test/ResultsFeatureTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.scalatest.featurespec.AnyFeatureSpec
import org.scalatest.matchers.should.Matchers
import org.scalatest.{DoNotDiscover, GivenWhenThen}

import collection.JavaConverters._
import scala.jdk.CollectionConverters._
import tools.MatchListFeatureTools

@DoNotDiscover class ResultsFeatureTest
Expand Down
12 changes: 6 additions & 6 deletions sport/test/football/model/CompetitionStageTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ import test._
}

"does not add leagueTableEntries for other rounds to group stage" in {
all(leagueTableEntries0) should have('stageNumber ("1"))
all(leagueTableEntries1) should have('stageNumber ("2"))
all(leagueTableEntries0) should have(Symbol("stageNumber")("1"))
all(leagueTableEntries1) should have(Symbol("stageNumber")("2"))
}

"can get the matches for a given round" in {
val testRound = Round("1", Some("Group A"))
all(stages(0).asInstanceOf[Groups].roundMatches(testRound)) should have('round (testRound))
all(stages(0).asInstanceOf[Groups].roundMatches(testRound)) should have(Symbol("round")(testRound))
}
}
}
Expand All @@ -139,8 +139,8 @@ import test._
}

"does not add leagueTableEntries for other stages" in {
all(leagueTable0) should have('stageNumber ("1"))
all(leagueTable1) should have('stageNumber ("2"))
all(leagueTable0) should have(Symbol("stageNumber")("1"))
all(leagueTable1) should have(Symbol("stageNumber")("2"))
}
}
}
Expand Down Expand Up @@ -169,7 +169,7 @@ import test._

"can get the matches for a given round" in {
val testRound = Round("1", Some("Quarter Final"))
all(stages(0).asInstanceOf[Knockout].roundMatches(testRound)) should have('round (testRound))
all(stages(0).asInstanceOf[Knockout].roundMatches(testRound)) should have(Symbol("round")(testRound))
}
}

Expand Down
2 changes: 1 addition & 1 deletion sport/test/tools/MatchListFeatureTools.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.fluentlenium.core.domain.{FluentList, FluentWebElement}
import org.openqa.selenium.interactions.Actions
import play.api.test.TestBrowser

import collection.JavaConverters._
import scala.jdk.CollectionConverters._
import org.scalatest.matchers.should.Matchers

trait MatchListFeatureTools extends Matchers {
Expand Down

0 comments on commit 0d1510d

Please sign in to comment.