From 3d4c19483ee5a765a035a26057d02013889d65e4 Mon Sep 17 00:00:00 2001 From: Reece-Carruthers <99188015+Reece-Carruthers@users.noreply.github.com> Date: Thu, 7 Nov 2024 08:25:04 +0000 Subject: [PATCH] package-refactor: Fix deprecations move page specs into package --- .../DownloadRequestSuccessController.scala | 2 +- app/controllers/RequestDataController.scala | 2 +- app/navigation/CategorisationNavigator.scala | 12 +++++------- build.sbt | 8 +++++--- test/pages/{ => profile}/HasNiphlPageSpec.scala | 5 ++--- test/pages/{ => profile}/HasNirmsPageSpec.scala | 5 ++--- test/pages/{ => profile}/RemoveNirmsPageSpec.scala | 5 ++--- 7 files changed, 18 insertions(+), 21 deletions(-) rename test/pages/{ => profile}/HasNiphlPageSpec.scala (95%) rename test/pages/{ => profile}/HasNirmsPageSpec.scala (95%) rename test/pages/{ => profile}/RemoveNirmsPageSpec.scala (94%) diff --git a/app/controllers/DownloadRequestSuccessController.scala b/app/controllers/DownloadRequestSuccessController.scala index f241f5d3..2da677fd 100644 --- a/app/controllers/DownloadRequestSuccessController.scala +++ b/app/controllers/DownloadRequestSuccessController.scala @@ -45,7 +45,7 @@ class DownloadRequestSuccessController @Inject() ( case _ => logErrorsAndContinue( "Email was not found", - routes.IndexController.onPageLoad + routes.IndexController.onPageLoad() ) } } diff --git a/app/controllers/RequestDataController.scala b/app/controllers/RequestDataController.scala index a0bfa133..53843d12 100644 --- a/app/controllers/RequestDataController.scala +++ b/app/controllers/RequestDataController.scala @@ -49,7 +49,7 @@ class RequestDataController @Inject() ( case _ => logErrorsAndContinue( "Email was not found", - routes.IndexController.onPageLoad + routes.IndexController.onPageLoad() ) } } diff --git a/app/navigation/CategorisationNavigator.scala b/app/navigation/CategorisationNavigator.scala index e8cfaa0b..7902b2a3 100644 --- a/app/navigation/CategorisationNavigator.scala +++ b/app/navigation/CategorisationNavigator.scala @@ -27,18 +27,16 @@ import utils.Constants.firstAssessmentNumber import javax.inject.{Inject, Singleton} @Singleton -class CategorisationNavigator @Inject() (categorisationService: CategorisationService) extends NavigatorTrait { +class CategorisationNavigator @Inject() (categorisationService: CategorisationService) extends NavigatorTrait { val normalRoutes: Page => UserAnswers => Call = { - case p: CategoryGuidancePage => + case p: CategoryGuidancePage => _ => routes.AssessmentController.onPageLoad(NormalMode, p.recordId, firstAssessmentNumber) - case _ => _ => routes.IndexController.onPageLoad() + case _ => _ => routes.IndexController.onPageLoad() } - val checkRoutes: Page => UserAnswers => Call = { - - case _ => _ => routes.JourneyRecoveryController.onPageLoad() + val checkRoutes: Page => UserAnswers => Call = { case _ => + _ => routes.JourneyRecoveryController.onPageLoad() } - } diff --git a/build.sbt b/build.sbt index f2ca5c9d..3f7cfa7e 100644 --- a/build.sbt +++ b/build.sbt @@ -11,7 +11,7 @@ ThisBuild / scalaVersion := "2.13.12" lazy val microservice = (project in file(".")) .enablePlugins(PlayScala, SbtDistributablesPlugin) .disablePlugins(JUnitXmlReportPlugin) //Required to prevent https://github.com/scalatest/scalatest/issues/1427 - .settings(inConfig(Test)(testSettings): _*) + .settings(inConfig(Test)(testSettings) *) .settings(ThisBuild / useSuperShell := false) .settings( name := appName, @@ -59,7 +59,7 @@ lazy val microservice = (project in file(".")) Assets / pipelineStages := Seq(concat) ) -lazy val testSettings: Seq[Def.Setting[_]] = Seq( +lazy val testSettings: Seq[Def.Setting[?]] = Seq( fork := true, unmanagedSourceDirectories += baseDirectory.value / "test-utils", scalafmtOnCompile := true @@ -73,4 +73,6 @@ lazy val it = addCommandAlias("testAndCoverage", ";clean;coverage;test;it/test;coverageReport") addCommandAlias("prePR", ";scalafmt;test:scalafmt;testAndCoverage") -addCommandAlias("preMerge", ";scalafmtCheckAll;testAndCoverage") \ No newline at end of file +addCommandAlias("preMerge", ";scalafmtCheckAll;testAndCoverage") + +scalacOptions += "-deprecation" \ No newline at end of file diff --git a/test/pages/HasNiphlPageSpec.scala b/test/pages/profile/HasNiphlPageSpec.scala similarity index 95% rename from test/pages/HasNiphlPageSpec.scala rename to test/pages/profile/HasNiphlPageSpec.scala index 6f94e9d4..04ef9915 100644 --- a/test/pages/HasNiphlPageSpec.scala +++ b/test/pages/profile/HasNiphlPageSpec.scala @@ -14,14 +14,13 @@ * limitations under the License. */ -package pages +package pages.profile import base.TestConstants.userAnswersId import models.UserAnswers -import org.scalatest.{OptionValues, TryValues} import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.must.Matchers -import pages.profile.{HasNiphlPage, NiphlNumberPage} +import org.scalatest.{OptionValues, TryValues} class HasNiphlPageSpec extends AnyFreeSpec with Matchers with TryValues with OptionValues { diff --git a/test/pages/HasNirmsPageSpec.scala b/test/pages/profile/HasNirmsPageSpec.scala similarity index 95% rename from test/pages/HasNirmsPageSpec.scala rename to test/pages/profile/HasNirmsPageSpec.scala index 86f9f9fd..b8a3aea5 100644 --- a/test/pages/HasNirmsPageSpec.scala +++ b/test/pages/profile/HasNirmsPageSpec.scala @@ -14,14 +14,13 @@ * limitations under the License. */ -package pages +package pages.profile import base.TestConstants.userAnswersId import models.UserAnswers -import org.scalatest.{OptionValues, TryValues} import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.must.Matchers -import pages.profile.{HasNirmsPage, NirmsNumberPage} +import org.scalatest.{OptionValues, TryValues} class HasNirmsPageSpec extends AnyFreeSpec with Matchers with TryValues with OptionValues { diff --git a/test/pages/RemoveNirmsPageSpec.scala b/test/pages/profile/RemoveNirmsPageSpec.scala similarity index 94% rename from test/pages/RemoveNirmsPageSpec.scala rename to test/pages/profile/RemoveNirmsPageSpec.scala index e1c3508b..d47f5224 100644 --- a/test/pages/RemoveNirmsPageSpec.scala +++ b/test/pages/profile/RemoveNirmsPageSpec.scala @@ -14,14 +14,13 @@ * limitations under the License. */ -package pages +package pages.profile import base.TestConstants.userAnswersId import models.UserAnswers -import org.scalatest.{OptionValues, TryValues} import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.must.Matchers -import pages.profile.{HasNirmsUpdatePage, NirmsNumberUpdatePage, RemoveNirmsPage} +import org.scalatest.{OptionValues, TryValues} class RemoveNirmsPageSpec extends AnyFreeSpec with Matchers with TryValues with OptionValues {