Skip to content

Commit

Permalink
package-refactor: Fix deprecations move page specs into package
Browse files Browse the repository at this point in the history
  • Loading branch information
Reece-Carruthers committed Nov 7, 2024
1 parent 26d1244 commit 3d4c194
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 21 deletions.
2 changes: 1 addition & 1 deletion app/controllers/DownloadRequestSuccessController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class DownloadRequestSuccessController @Inject() (
case _ =>
logErrorsAndContinue(
"Email was not found",
routes.IndexController.onPageLoad
routes.IndexController.onPageLoad()
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/RequestDataController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class RequestDataController @Inject() (
case _ =>
logErrorsAndContinue(
"Email was not found",
routes.IndexController.onPageLoad
routes.IndexController.onPageLoad()
)
}
}
Expand Down
12 changes: 5 additions & 7 deletions app/navigation/CategorisationNavigator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}


}
8 changes: 5 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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")
addCommandAlias("preMerge", ";scalafmtCheckAll;testAndCoverage")

scalacOptions += "-deprecation"
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down

0 comments on commit 3d4c194

Please sign in to comment.