From ebcdc8cb4a4cc3e3ba04aaf31578b7c9599e4572 Mon Sep 17 00:00:00 2001 From: robpetterson Date: Tue, 18 Jun 2024 11:22:32 +0100 Subject: [PATCH 1/9] DDCE-5464: Upgrade play frontend and removed mockito-scala-scalatest --- app/assets/stylesheets/application.scss | 5 +++-- project/AppDependencies.scala | 9 ++++----- project/plugins.sbt | 2 +- .../controllers/AgentDetailsControllerSpec.scala | 6 +++--- .../CheckYourAnswersAmendHandlerSpec.scala | 10 +++++----- .../controllers/CheckYourAnswersControllerSpec.scala | 12 ++++++------ .../controllers/CheckYourAnswersNewHandlerSpec.scala | 6 +++--- .../controllers/CustomsAgentControllerSpec.scala | 6 +++--- .../controllers/EnterEmailControllerSpec.scala | 6 +++--- .../controllers/EoriNumberControllerSpec.scala | 4 ++-- .../ExciseAndRestrictedGoodsControllerSpec.scala | 6 +++--- .../controllers/GoodsDestinationControllerSpec.scala | 6 +++--- .../controllers/GoodsInVehicleControllerSpec.scala | 6 +++--- .../controllers/GoodsOriginControllerSpec.scala | 6 +++--- .../controllers/GoodsTypeControllerSpec.scala | 6 +++--- .../controllers/GoodsVatRateControllerSpec.scala | 6 +++--- .../ImportExportChoiceControllerSpec.scala | 6 +++--- .../controllers/JourneyDetailsControllerSpec.scala | 6 +++--- .../controllers/NewOrExistingControllerSpec.scala | 6 +++--- .../PreviousDeclarationDetailsControllerSpec.scala | 8 ++++---- .../controllers/PurchaseDetailsControllerSpec.scala | 6 +++--- .../controllers/RemoveGoodsControllerSpec.scala | 6 +++--- .../RetrieveDeclarationControllerSpec.scala | 6 +++--- .../controllers/ReviewGoodsControllerSpec.scala | 8 ++++---- .../scheduler/ScheduledJobSpec.scala | 12 ++++++------ .../merchandiseinbaggage/service/AuditorSpec.scala | 4 ++-- .../service/DocumentUpdateServiceSpec.scala | 10 +++++----- .../service/MibServiceSpec.scala | 6 +++--- .../utils/DeclarationJourneyLoggerSpec.scala | 6 +++--- 29 files changed, 96 insertions(+), 96 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 7d0c050b2..3a177796c 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,7 +1,8 @@ -$govuk-assets-path: "/declare-commercial-goods/assets/lib/govuk-frontend/govuk/assets/"; +//$govuk-assets-path: "/declare-commercial-goods/assets/lib/govuk-frontend/govuk/assets/"; $hmrc-assets-path: "/declare-commercial-goods/assets/lib/hmrc-frontend/hmrc/"; -@import "lib/govuk-frontend/govuk/all"; +//@import "lib/govuk-frontend/govuk/all"; +@import "lib/govuk-frontend/dist/govuk/all"; @import "lib/hmrc-frontend/hmrc/all"; @import "autocomplete"; @import "language-selection"; diff --git a/project/AppDependencies.scala b/project/AppDependencies.scala index 22a7babd3..e5b7f8462 100644 --- a/project/AppDependencies.scala +++ b/project/AppDependencies.scala @@ -6,8 +6,8 @@ object AppDependencies { private val compile: Seq[ModuleID] = Seq( "uk.gov.hmrc" %% "bootstrap-frontend-play-30" % bootstrapVersion, - "uk.gov.hmrc" %% "play-frontend-hmrc-play-30" % "8.5.0", - "uk.gov.hmrc.mongo" %% "hmrc-mongo-play-30" % "1.9.0", + "uk.gov.hmrc" %% "play-frontend-hmrc-play-30" % "10.1.0", + "uk.gov.hmrc.mongo" %% "hmrc-mongo-play-30" % "2.0.0", "com.beachape" %% "enumeratum-play" % "1.8.0", "org.webjars.npm" % "accessible-autocomplete" % "2.0.4", "com.softwaremill.quicklens" %% "quicklens" % "1.9.7", @@ -16,9 +16,8 @@ object AppDependencies { ) private val test: Seq[ModuleID] = Seq( - "uk.gov.hmrc" %% "bootstrap-test-play-30" % bootstrapVersion, - "org.scalatestplus" %% "scalacheck-1-17" % "3.2.18.0", - "org.mockito" %% "mockito-scala-scalatest" % "1.17.31" + "uk.gov.hmrc" %% "bootstrap-test-play-30" % bootstrapVersion, + "org.scalatestplus" %% "scalacheck-1-17" % "3.2.18.0" ).map(_ % Test) // only add additional dependencies here - it test inherit test dependencies above already diff --git a/project/plugins.sbt b/project/plugins.sbt index 2efeaeccc..42e10d9e4 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -11,4 +11,4 @@ addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") addSbtPlugin("org.scalastyle" % "scalastyle-sbt-plugin" % "1.0.0" exclude ("org.scala-lang.modules", "scala-xml_2.12")) addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.12") addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4") -addSbtPlugin("uk.gov.hmrc" % "sbt-accessibility-linter" % "0.39.0") +addSbtPlugin("uk.gov.hmrc" % "sbt-accessibility-linter" % "1.0.0") diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/AgentDetailsControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/AgentDetailsControllerSpec.scala index 35e01f406..6d75b4e27 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/AgentDetailsControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/AgentDetailsControllerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.Result import play.api.test.Helpers._ import uk.gov.hmrc.merchandiseinbaggage.controllers.routes._ @@ -33,7 +33,7 @@ import scala.concurrent.{ExecutionContext, Future} class AgentDetailsControllerSpec extends DeclarationJourneyControllerSpec { private val view: AgentDetailsView = app.injector.instanceOf[AgentDetailsView] - private val mockNavigator: Navigator = mock[Navigator] + private val mockNavigator: Navigator = mock(classOf[Navigator]) def controller(declarationJourney: DeclarationJourney): AgentDetailsController = new AgentDetailsController( diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/CheckYourAnswersAmendHandlerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/CheckYourAnswersAmendHandlerSpec.scala index 713edf4b8..e1412f0be 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/CheckYourAnswersAmendHandlerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/CheckYourAnswersAmendHandlerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.{any, eqTo} -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.{any, eq => eqTo} +import org.mockito.Mockito.{mock, when} import play.api.mvc.{Request, Result} import play.api.test.Helpers._ import uk.gov.hmrc.http.HeaderCarrier @@ -42,9 +42,9 @@ class CheckYourAnswersAmendHandlerSpec extends DeclarationJourneyControllerSpec private val importView: CheckYourAnswersAmendImportView = injector.instanceOf[CheckYourAnswersAmendImportView] private val exportView: CheckYourAnswersAmendExportView = injector.instanceOf[CheckYourAnswersAmendExportView] private val mibConnector: MibConnector = injector.instanceOf[MibConnector] - private val mockTpsPaymentsService: TpsPaymentsService = mock[TpsPaymentsService] - private val paymentService: PaymentService = mock[PaymentService] - private val mockMibService: MibService = mock[MibService] + private val mockTpsPaymentsService: TpsPaymentsService = mock(classOf[TpsPaymentsService]) + private val paymentService: PaymentService = mock(classOf[PaymentService]) + private val mockMibService: MibService = mock(classOf[MibService]) private val sessionId: SessionId = SessionId() diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/CheckYourAnswersControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/CheckYourAnswersControllerSpec.scala index 575ec9635..e3cd32671 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/CheckYourAnswersControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/CheckYourAnswersControllerSpec.scala @@ -17,8 +17,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers import cats.data.OptionT -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.Results._ import play.api.mvc.{Request, RequestHeader, Result} import play.api.test.Helpers._ @@ -51,8 +51,8 @@ class CheckYourAnswersControllerSpec extends DeclarationJourneyControllerSpec { private val mibConnector: MibConnector = injector.instanceOf[MibConnector] private val auditConnector: AuditConnector = injector.instanceOf[AuditConnector] - private val mockMibService: MibService = mock[MibService] - private val mockTpsService: TpsPaymentsService = mock[TpsPaymentsService] + private val mockMibService: MibService = mock(classOf[MibService]) + private val mockTpsService: TpsPaymentsService = mock(classOf[TpsPaymentsService]) private lazy val testPaymentConnector: PaymentConnector = new PaymentConnector(appConfig, httpClient) { override def sendPaymentRequest( @@ -162,8 +162,8 @@ class CheckYourAnswersControllerSpec extends DeclarationJourneyControllerSpec { val sessionId = SessionId() val journey: DeclarationJourney = completedDeclarationJourney.copy(sessionId = sessionId, journeyType = journeyType, isAssistedDigital = true) - val mockHandler: CheckYourAnswersNewHandler = mock[CheckYourAnswersNewHandler] - val mockAmendHandler: CheckYourAnswersAmendHandler = mock[CheckYourAnswersAmendHandler] + val mockHandler: CheckYourAnswersNewHandler = mock(classOf[CheckYourAnswersNewHandler]) + val mockAmendHandler: CheckYourAnswersAmendHandler = mock(classOf[CheckYourAnswersAmendHandler]) def controller(declarationJourney: DeclarationJourney): CheckYourAnswersController = new CheckYourAnswersController( diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/CheckYourAnswersNewHandlerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/CheckYourAnswersNewHandlerSpec.scala index 38d7621a1..d75d6db5f 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/CheckYourAnswersNewHandlerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/CheckYourAnswersNewHandlerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.{any, eqTo} -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.{any, eq => eqTo} +import org.mockito.Mockito.{mock, when} import play.api.mvc.{Request, Result} import play.api.test.Helpers._ import uk.gov.hmrc.http.{HeaderCarrier, HttpClient} @@ -43,7 +43,7 @@ class CheckYourAnswersNewHandlerSpec extends DeclarationJourneyControllerSpec { private lazy val exportView: CheckYourAnswersExportView = injector.instanceOf[CheckYourAnswersExportView] private lazy val mibConnector: MibConnector = injector.instanceOf[MibConnector] private val auditConnector: AuditConnector = injector.instanceOf[AuditConnector] - private lazy val mockTpsPaymentsService: TpsPaymentsService = mock[TpsPaymentsService] + private lazy val mockTpsPaymentsService: TpsPaymentsService = mock(classOf[TpsPaymentsService]) implicit val hc: HeaderCarrier = HeaderCarrier() diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/CustomsAgentControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/CustomsAgentControllerSpec.scala index 348494e75..57cf62f16 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/CustomsAgentControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/CustomsAgentControllerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.Result import play.api.test.Helpers._ import uk.gov.hmrc.merchandiseinbaggage.controllers.routes._ @@ -32,7 +32,7 @@ import scala.concurrent.{ExecutionContext, Future} class CustomsAgentControllerSpec extends DeclarationJourneyControllerSpec { val view: CustomsAgentView = app.injector.instanceOf[CustomsAgentView] - val mockNavigator: Navigator = mock[Navigator] + val mockNavigator: Navigator = mock(classOf[Navigator]) val controller: DeclarationJourney => CustomsAgentController = declarationJourney => new CustomsAgentController( diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/EnterEmailControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/EnterEmailControllerSpec.scala index 2ef2bc16a..b0ec6a656 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/EnterEmailControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/EnterEmailControllerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.Result import play.api.test.Helpers._ import uk.gov.hmrc.merchandiseinbaggage.controllers.routes._ @@ -33,7 +33,7 @@ class EnterEmailControllerSpec extends DeclarationJourneyControllerSpec { private val view: EnterEmailView = app.injector.instanceOf[EnterEmailView] private val viewOpt: EnterOptionalEmailView = app.injector.instanceOf[EnterOptionalEmailView] - val mockNavigator: Navigator = mock[Navigator] + val mockNavigator: Navigator = mock(classOf[Navigator]) def controller(declarationJourney: DeclarationJourney): EnterEmailController = new EnterEmailController( diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/EoriNumberControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/EoriNumberControllerSpec.scala index e8a1a340c..0cf3bf17d 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/EoriNumberControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/EoriNumberControllerSpec.scala @@ -16,7 +16,7 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.MockitoSugar.mock +import org.mockito.Mockito.mock import play.api.mvc.Result import play.api.test.Helpers._ import uk.gov.hmrc.http.{HeaderCarrier, HttpClient} @@ -31,7 +31,7 @@ class EoriNumberControllerSpec extends DeclarationJourneyControllerSpec { val view: EoriNumberView = injector.instanceOf[EoriNumberView] val client: HttpClient = injector.instanceOf[HttpClient] - val mockNavigator: Navigator = mock[Navigator] + val mockNavigator: Navigator = mock(classOf[Navigator]) val connector: MibConnector = new MibConnector(appConfig, client) { override def checkEoriNumber(eori: String)(implicit hc: HeaderCarrier): Future[CheckResponse] = Future.successful(CheckResponse("123", valid = false, None)) diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/ExciseAndRestrictedGoodsControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/ExciseAndRestrictedGoodsControllerSpec.scala index 800f02adb..4261cbf3b 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/ExciseAndRestrictedGoodsControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/ExciseAndRestrictedGoodsControllerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.Result import play.api.test.Helpers._ import uk.gov.hmrc.merchandiseinbaggage.controllers.routes._ @@ -33,7 +33,7 @@ import scala.concurrent.{ExecutionContext, Future} class ExciseAndRestrictedGoodsControllerSpec extends DeclarationJourneyControllerSpec with PropertyBaseTables { val view: ExciseAndRestrictedGoodsView = app.injector.instanceOf[ExciseAndRestrictedGoodsView] - val mockNavigator: Navigator = mock[Navigator] + val mockNavigator: Navigator = mock(classOf[Navigator]) def controller(declarationJourney: DeclarationJourney): ExciseAndRestrictedGoodsController = new ExciseAndRestrictedGoodsController( controllerComponents, diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsDestinationControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsDestinationControllerSpec.scala index 3f68fd29b..f9be63485 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsDestinationControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsDestinationControllerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.Result import play.api.test.Helpers._ import uk.gov.hmrc.merchandiseinbaggage.controllers.routes._ @@ -34,7 +34,7 @@ class GoodsDestinationControllerSpec extends DeclarationJourneyControllerSpec wi val view: GoodsDestinationView = injector.instanceOf[GoodsDestinationView] - val mockNavigator: Navigator = mock[Navigator] + val mockNavigator: Navigator = mock(classOf[Navigator]) def controller(declarationJourney: DeclarationJourney): GoodsDestinationController = new GoodsDestinationController( diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsInVehicleControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsInVehicleControllerSpec.scala index a42c1bd53..871ef01ac 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsInVehicleControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsInVehicleControllerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.Result import play.api.test.Helpers._ import uk.gov.hmrc.merchandiseinbaggage.controllers.routes._ @@ -31,7 +31,7 @@ import scala.concurrent.{ExecutionContext, Future} class GoodsInVehicleControllerSpec extends DeclarationJourneyControllerSpec { private val view: GoodsInVehicleView = app.injector.instanceOf[GoodsInVehicleView] - val mockNavigator: Navigator = mock[Navigator] + val mockNavigator: Navigator = mock(classOf[Navigator]) def controller(declarationJourney: DeclarationJourney): GoodsInVehicleController = new GoodsInVehicleController( diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsOriginControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsOriginControllerSpec.scala index fa6f39804..8341c5ac2 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsOriginControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsOriginControllerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.Result import play.api.test.Helpers._ import uk.gov.hmrc.merchandiseinbaggage.controllers.routes._ @@ -31,7 +31,7 @@ import scala.concurrent.{ExecutionContext, Future} class GoodsOriginControllerSpec extends DeclarationJourneyControllerSpec { private val view: GoodsOriginView = app.injector.instanceOf[GoodsOriginView] - val mockNavigator: Navigator = mock[Navigator] + val mockNavigator: Navigator = mock(classOf[Navigator]) def controller(declarationJourney: DeclarationJourney): GoodsOriginController = new GoodsOriginController( diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsTypeControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsTypeControllerSpec.scala index 46f827990..037a2d669 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsTypeControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsTypeControllerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.{Call, Result} import play.api.test.Helpers._ import uk.gov.hmrc.merchandiseinbaggage.controllers.routes._ @@ -33,7 +33,7 @@ import scala.concurrent.{ExecutionContext, Future} class GoodsTypeControllerSpec extends DeclarationJourneyControllerSpec { private val view: GoodsTypeView = app.injector.instanceOf[GoodsTypeView] - val mockNavigator: Navigator = mock[Navigator] + val mockNavigator: Navigator = mock(classOf[Navigator]) def controller(declarationJourney: DeclarationJourney): GoodsTypeController = new GoodsTypeController( diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsVatRateControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsVatRateControllerSpec.scala index 6b542ff47..8012b32e6 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsVatRateControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/GoodsVatRateControllerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.Result import play.api.test.Helpers._ import uk.gov.hmrc.merchandiseinbaggage.controllers.routes._ @@ -32,7 +32,7 @@ import scala.concurrent.{ExecutionContext, Future} class GoodsVatRateControllerSpec extends DeclarationJourneyControllerSpec { private val view: GoodsVatRateView = app.injector.instanceOf[GoodsVatRateView] - private val mockNavigator: Navigator = mock[Navigator] + private val mockNavigator: Navigator = mock(classOf[Navigator]) def controller(declarationJourney: DeclarationJourney): GoodsVatRateController = new GoodsVatRateController( controllerComponents, diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/ImportExportChoiceControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/ImportExportChoiceControllerSpec.scala index 4b7c75565..19226a3a0 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/ImportExportChoiceControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/ImportExportChoiceControllerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.Result import play.api.test.Helpers._ import uk.gov.hmrc.merchandiseinbaggage.controllers.routes._ @@ -33,7 +33,7 @@ import scala.concurrent.{ExecutionContext, Future} class ImportExportChoiceControllerSpec extends DeclarationJourneyControllerSpec { val view: ImportExportChoice = injector.instanceOf[ImportExportChoice] - val mockNavigator: Navigator = mock[Navigator] + val mockNavigator: Navigator = mock(classOf[Navigator]) val journey: DeclarationJourney = startedImportJourney.copy(isAssistedDigital = true) val controller: ImportExportChoiceController = new ImportExportChoiceController( diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/JourneyDetailsControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/JourneyDetailsControllerSpec.scala index d53e8117a..8eca62301 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/JourneyDetailsControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/JourneyDetailsControllerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.Result import play.api.test.Helpers._ import uk.gov.hmrc.merchandiseinbaggage.controllers.routes._ @@ -33,7 +33,7 @@ import scala.concurrent.{ExecutionContext, Future} class JourneyDetailsControllerSpec extends DeclarationJourneyControllerSpec { private val view: JourneyDetailsPage = app.injector.instanceOf[JourneyDetailsPage] - private val mockNavigator: Navigator = mock[Navigator] + private val mockNavigator: Navigator = mock(classOf[Navigator]) private val controller: DeclarationJourney => JourneyDetailsController = declarationJourney => new JourneyDetailsController( diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/NewOrExistingControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/NewOrExistingControllerSpec.scala index 23475e17e..14790dfbc 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/NewOrExistingControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/NewOrExistingControllerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.Result import play.api.test.Helpers._ import uk.gov.hmrc.merchandiseinbaggage.controllers.routes._ @@ -32,7 +32,7 @@ import scala.concurrent.{ExecutionContext, Future} class NewOrExistingControllerSpec extends DeclarationJourneyControllerSpec { private val view: NewOrExistingView = injector.instanceOf[NewOrExistingView] - private val mockNavigator: Navigator = mock[Navigator] + private val mockNavigator: Navigator = mock(classOf[Navigator]) def controller(declarationJourney: DeclarationJourney): NewOrExistingController = new NewOrExistingController( controllerComponents, diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/PreviousDeclarationDetailsControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/PreviousDeclarationDetailsControllerSpec.scala index b309633a1..28bb7e310 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/PreviousDeclarationDetailsControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/PreviousDeclarationDetailsControllerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.test.Helpers._ import uk.gov.hmrc.http.HeaderCarrier import uk.gov.hmrc.merchandiseinbaggage.CoreTestData @@ -34,8 +34,8 @@ import scala.concurrent.Future class PreviousDeclarationDetailsControllerSpec extends DeclarationJourneyControllerSpec with CoreTestData { - val mockNavigator: Navigator = mock[Navigator] - val mockMibService: MibService = mock[MibService] + val mockNavigator: Navigator = mock(classOf[Navigator]) + val mockMibService: MibService = mock(classOf[MibService]) val view: PreviousDeclarationDetailsView = app.injector.instanceOf[PreviousDeclarationDetailsView] val mibConnector: MibConnector = injector.instanceOf[MibConnector] diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/PurchaseDetailsControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/PurchaseDetailsControllerSpec.scala index 249b2effb..7b74bc982 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/PurchaseDetailsControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/PurchaseDetailsControllerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.Result import play.api.test.Helpers._ import uk.gov.hmrc.merchandiseinbaggage.connectors.MibConnector @@ -35,7 +35,7 @@ class PurchaseDetailsControllerSpec extends DeclarationJourneyControllerSpec { private val importView: PurchaseDetailsImportView = app.injector.instanceOf[PurchaseDetailsImportView] private val exportView: PurchaseDetailsExportView = app.injector.instanceOf[PurchaseDetailsExportView] private val mibConnector: MibConnector = injector.instanceOf[MibConnector] - private val mockNavigator: Navigator = mock[Navigator] + private val mockNavigator: Navigator = mock(classOf[Navigator]) def controller(declarationJourney: DeclarationJourney): PurchaseDetailsController = new PurchaseDetailsController( diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/RemoveGoodsControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/RemoveGoodsControllerSpec.scala index 81af95a66..68f6687b2 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/RemoveGoodsControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/RemoveGoodsControllerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.Result import play.api.test.Helpers._ import uk.gov.hmrc.merchandiseinbaggage.CoreTestData @@ -33,7 +33,7 @@ class RemoveGoodsControllerSpec extends DeclarationJourneyControllerSpec with Co val repo: DeclarationJourneyRepository = app.injector.instanceOf[DeclarationJourneyRepository] val view: RemoveGoodsView = app.injector.instanceOf[RemoveGoodsView] - val mockNavigator: Navigator = mock[Navigator] + val mockNavigator: Navigator = mock(classOf[Navigator]) val controller: RemoveGoodsController = new RemoveGoodsController(controllerComponents, actionBuilder, repo, mockNavigator, view) diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/RetrieveDeclarationControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/RetrieveDeclarationControllerSpec.scala index a2056d044..e97b7efa5 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/RetrieveDeclarationControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/RetrieveDeclarationControllerSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.Result import play.api.test.Helpers._ import uk.gov.hmrc.merchandiseinbaggage.connectors.MibConnector @@ -37,7 +37,7 @@ class RetrieveDeclarationControllerSpec extends DeclarationJourneyControllerSpec val view: RetrieveDeclarationView = injector.instanceOf[RetrieveDeclarationView] val connector: MibConnector = injector.instanceOf[MibConnector] - val mockNavigator: Navigator = mock[Navigator] + val mockNavigator: Navigator = mock(classOf[Navigator]) def controller(declarationJourney: DeclarationJourney): RetrieveDeclarationController = new RetrieveDeclarationController( diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/ReviewGoodsControllerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/ReviewGoodsControllerSpec.scala index 630b354f2..dc7c73595 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/controllers/ReviewGoodsControllerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/controllers/ReviewGoodsControllerSpec.scala @@ -17,8 +17,8 @@ package uk.gov.hmrc.merchandiseinbaggage.controllers import cats.data.OptionT -import org.mockito.ArgumentMatchersSugar.any -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import play.api.mvc.Result import play.api.test.Helpers._ import uk.gov.hmrc.http.HeaderCarrier @@ -39,8 +39,8 @@ import scala.concurrent.{ExecutionContext, Future} class ReviewGoodsControllerSpec extends DeclarationJourneyControllerSpec with PropertyBaseTables { private val view: ReviewGoodsView = app.injector.instanceOf[ReviewGoodsView] - private val mockNavigator: Navigator = mock[Navigator] - private val mockMibService: MibService = mock[MibService] + private val mockNavigator: Navigator = mock(classOf[Navigator]) + private val mockMibService: MibService = mock(classOf[MibService]) def controller(declarationJourney: DeclarationJourney): ReviewGoodsController = new ReviewGoodsController( diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/scheduler/ScheduledJobSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/scheduler/ScheduledJobSpec.scala index d7c84ecb3..09d493791 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/scheduler/ScheduledJobSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/scheduler/ScheduledJobSpec.scala @@ -25,14 +25,14 @@ import play.api.Configuration import play.api.inject.ApplicationLifecycle import uk.gov.hmrc.merchandiseinbaggage.scheduler.SchedulingActor.UpdateDocumentsClass import uk.gov.hmrc.merchandiseinbaggage.service.DocumentUpdateService -import org.mockito.MockitoSugar +import org.mockito.Mockito.{mock, reset} -class ScheduledJobSpec extends AnyWordSpecLike with Matchers with MockitoSugar { +class ScheduledJobSpec extends AnyWordSpecLike with Matchers { val jobNameTest = "testJobName" - val mockActorSystem: ActorSystem = mock[ActorSystem] - val mockService: DocumentUpdateService = mock[DocumentUpdateService] - val mockApplicationLifecycle: ApplicationLifecycle = mock[ApplicationLifecycle] - val mockQuartzSchedulerExtension: QuartzSchedulerExtension = mock[QuartzSchedulerExtension] + val mockActorSystem: ActorSystem = mock(classOf[ActorSystem]) + val mockService: DocumentUpdateService = mock(classOf[DocumentUpdateService]) + val mockApplicationLifecycle: ApplicationLifecycle = mock(classOf[ApplicationLifecycle]) + val mockQuartzSchedulerExtension: QuartzSchedulerExtension = mock(classOf[QuartzSchedulerExtension]) class Setup(cronString: String, enabled: Boolean = false) { val testConfig: Configuration = Configuration( diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/service/AuditorSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/service/AuditorSpec.scala index ff4e58f45..d60e9e247 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/service/AuditorSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/service/AuditorSpec.scala @@ -16,7 +16,7 @@ package uk.gov.hmrc.merchandiseinbaggage.service -import org.mockito.MockitoSugar.mock +import org.mockito.Mockito.mock import org.scalatest.concurrent.ScalaFutures import play.api.i18n.MessagesApi import play.api.libs.json.JsValue @@ -34,7 +34,7 @@ import scala.concurrent.Future class AuditorSpec extends BaseSpec with CoreTestData with ScalaFutures { private val failed: Failure = Failure("failed") - private val aMessagesApi: MessagesApi = mock[MessagesApi] + private val aMessagesApi: MessagesApi = mock(classOf[MessagesApi]) private implicit val aHeaderCarrier: HeaderCarrier = HeaderCarrier() diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/service/DocumentUpdateServiceSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/service/DocumentUpdateServiceSpec.scala index aaa596dab..41b6cc613 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/service/DocumentUpdateServiceSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/service/DocumentUpdateServiceSpec.scala @@ -19,7 +19,7 @@ package uk.gov.hmrc.merchandiseinbaggage.service import org.bson.types.ObjectId import org.mockito.ArgumentMatchers.any import org.scalatest.{BeforeAndAfterEach, RecoverMethods} -import org.mockito.MockitoSugar +import org.mockito.Mockito.{mock, reset, times, verify, when} import play.api.mvc.ControllerComponents import play.api.test.Helpers.stubControllerComponents import uk.gov.hmrc.merchandiseinbaggage.BaseSpec @@ -31,11 +31,11 @@ import scala.concurrent.Await.result import scala.concurrent.duration.Duration import scala.concurrent.{ExecutionContext, Future} -class DocumentUpdateServiceSpec extends BaseSpec with BeforeAndAfterEach with RecoverMethods with MockitoSugar { +class DocumentUpdateServiceSpec extends BaseSpec with BeforeAndAfterEach with RecoverMethods { - val mockDeclarationJourneyMongo: DeclarationJourneyRepository = mock[DeclarationJourneyRepository] - val mockLockKeeper: LockRepositoryProvider = mock[LockRepositoryProvider] - val mockServicesConfig: ServicesConfig = mock[ServicesConfig] + val mockDeclarationJourneyMongo: DeclarationJourneyRepository = mock(classOf[DeclarationJourneyRepository]) + val mockLockKeeper: LockRepositoryProvider = mock(classOf[LockRepositoryProvider]) + val mockServicesConfig: ServicesConfig = mock(classOf[ServicesConfig]) val mockCc: ControllerComponents = stubControllerComponents() implicit val ec: ExecutionContext = mockCc.executionContext diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/service/MibServiceSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/service/MibServiceSpec.scala index 60e0348c3..2cf581be8 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/service/MibServiceSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/service/MibServiceSpec.scala @@ -16,8 +16,8 @@ package uk.gov.hmrc.merchandiseinbaggage.service -import org.mockito.ArgumentMatchersSugar.{any, eqTo} -import org.mockito.MockitoSugar.{mock, reset, when} +import org.mockito.ArgumentMatchers.{any, eq => eqTo} +import org.mockito.Mockito.{mock, reset, when} import org.mockito.invocation.InvocationOnMock import org.scalatest.{BeforeAndAfterEach, OptionValues} import uk.gov.hmrc.http.HeaderCarrier @@ -38,7 +38,7 @@ import scala.concurrent.Future class MibServiceSpec extends BaseSpecWithApplication with CoreTestData with OptionValues with BeforeAndAfterEach { private implicit val hc: HeaderCarrier = HeaderCarrier() - private val mockConnector: MibConnector = mock[MibConnector] + private val mockConnector: MibConnector = mock(classOf[MibConnector]) private val service: MibService = new MibService(mockConnector) private val (gbpAmount, duty, vat) = (7835, 0, 1567) diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/utils/DeclarationJourneyLoggerSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/utils/DeclarationJourneyLoggerSpec.scala index 11cc51123..a63fea59b 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/utils/DeclarationJourneyLoggerSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/utils/DeclarationJourneyLoggerSpec.scala @@ -16,7 +16,7 @@ package uk.gov.hmrc.merchandiseinbaggage.utils -import org.mockito.MockitoSugar.{mock, when} +import org.mockito.Mockito.{mock, when} import play.api.mvc.request.RequestTarget import play.api.mvc.{Cookies, Headers, RequestHeader} import uk.gov.hmrc.merchandiseinbaggage.BaseSpec @@ -26,9 +26,9 @@ class DeclarationJourneyLoggerSpec extends BaseSpec { "DeclarationJourneyLogger" should { "be able to warn" in { - implicit val mockRequest: RequestHeader = mock[RequestHeader] + implicit val mockRequest: RequestHeader = mock(classOf[RequestHeader]) - val mockTarget = mock[RequestTarget] + val mockTarget = mock(classOf[RequestTarget]) when(mockTarget.path).thenReturn("PATH") From 3204ca1373ec6ec63af9380c2a35c8e479cd925d Mon Sep 17 00:00:00 2001 From: robpetterson Date: Thu, 20 Jun 2024 10:38:19 +0100 Subject: [PATCH 2/9] DDCE-5464:cleaned up code with references to datastream --- project/AppDependencies.scala | 2 +- .../service/AuditorSpec.scala | 43 +++++++-------- .../service/TestAuditConnector.scala | 54 ------------------- 3 files changed, 20 insertions(+), 79 deletions(-) delete mode 100644 test/uk/gov/hmrc/merchandiseinbaggage/service/TestAuditConnector.scala diff --git a/project/AppDependencies.scala b/project/AppDependencies.scala index e5b7f8462..b613c2d90 100644 --- a/project/AppDependencies.scala +++ b/project/AppDependencies.scala @@ -7,7 +7,7 @@ object AppDependencies { private val compile: Seq[ModuleID] = Seq( "uk.gov.hmrc" %% "bootstrap-frontend-play-30" % bootstrapVersion, "uk.gov.hmrc" %% "play-frontend-hmrc-play-30" % "10.1.0", - "uk.gov.hmrc.mongo" %% "hmrc-mongo-play-30" % "2.0.0", + "uk.gov.hmrc.mongo" %% "hmrc-mongo-play-30" % "2.1.0", "com.beachape" %% "enumeratum-play" % "1.8.0", "org.webjars.npm" % "accessible-autocomplete" % "2.0.4", "com.softwaremill.quicklens" %% "quicklens" % "1.9.7", diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/service/AuditorSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/service/AuditorSpec.scala index d60e9e247..8c09208f7 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/service/AuditorSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/service/AuditorSpec.scala @@ -16,17 +16,20 @@ package uk.gov.hmrc.merchandiseinbaggage.service -import org.mockito.Mockito.mock +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{mock, when} import org.scalatest.concurrent.ScalaFutures import play.api.i18n.MessagesApi import play.api.libs.json.JsValue import play.api.libs.json.Json.toJson +import play.api.mvc.RequestHeader import uk.gov.hmrc.audit.HandlerResult import uk.gov.hmrc.http.HeaderCarrier import uk.gov.hmrc.merchandiseinbaggage.model.api.Declaration import uk.gov.hmrc.merchandiseinbaggage.{BaseSpec, CoreTestData} import uk.gov.hmrc.play.audit.http.connector.AuditConnector import uk.gov.hmrc.play.audit.http.connector.AuditResult.{Disabled, Failure, Success} +import uk.gov.hmrc.play.audit.model.ExtendedDataEvent import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.Future @@ -42,17 +45,13 @@ class AuditorSpec extends BaseSpec with CoreTestData with ScalaFutures { Seq(Success, Disabled, failed).foreach { auditStatus => s"delegate to the auditConnector and return $auditStatus" in { - val testAuditConnector = new TestAuditConnector("TestApp") { - override def sendResult(path: String, event: JsValue): Future[HandlerResult] = { - (event \ "auditSource").get.toString mustBe "\"merchandise-in-baggage-frontend\"" - (event \ "auditType").get.toString mustBe "\"DeclarationPaymentAttempted\"" - (event \ "detail").get mustBe toJson(declaration) - Future.successful(HandlerResult.Success) - } - } + val mockAuditConnector: AuditConnector = mock(classOf[AuditConnector]) + + when(mockAuditConnector.sendExtendedEvent(any())(any(), any())) + .thenReturn(Future.successful(auditStatus)) val auditService = new Auditor { - override val auditConnector: AuditConnector = testAuditConnector + override val auditConnector: AuditConnector = mockAuditConnector override val messagesApi: MessagesApi = aMessagesApi } @@ -63,17 +62,13 @@ class AuditorSpec extends BaseSpec with CoreTestData with ScalaFutures { "use DeclarationPaymentAttempted event for amendments" in { val aDeclarationWithAmendment: Declaration = declaration.copy(amendments = List(aAmendment)) - val testAuditConnector: TestAuditConnector = new TestAuditConnector("TestApp") { - override def sendResult(path: String, event: JsValue): Future[HandlerResult] = { - (event \ "auditSource").get.toString mustBe "\"merchandise-in-baggage-frontend\"" - (event \ "auditType").get.toString mustBe "\"DeclarationPaymentAttempted\"" - (event \ "detail").get mustBe toJson(aDeclarationWithAmendment) - Future.successful(HandlerResult.Success) - } - } + val mockAuditConnector: AuditConnector = mock(classOf[AuditConnector]) + + when(mockAuditConnector.sendExtendedEvent(any())(any(), any())) + .thenReturn(Future.successful(Success)) val auditService: Auditor = new Auditor { - override val auditConnector: AuditConnector = testAuditConnector + override val auditConnector: AuditConnector = mockAuditConnector override val messagesApi: MessagesApi = aMessagesApi } @@ -83,13 +78,13 @@ class AuditorSpec extends BaseSpec with CoreTestData with ScalaFutures { "handle auditConnector failure" in { val aDeclarationWithAmendment: Declaration = declaration.copy(amendments = List(aAmendment)) - val testAuditConnector: TestAuditConnector = new TestAuditConnector("TestApp") { - override def sendResult(path: String, event: JsValue): Future[HandlerResult] = - Future.successful(HandlerResult.Failure) - } + val mockAuditConnector: AuditConnector = mock(classOf[AuditConnector]) + + when(mockAuditConnector.sendExtendedEvent(any())(any(), any())) + .thenReturn(Future.successful(Success)) val auditService: Auditor = new Auditor { - override val auditConnector: AuditConnector = testAuditConnector + override val auditConnector: AuditConnector = mockAuditConnector override val messagesApi: MessagesApi = aMessagesApi } diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/service/TestAuditConnector.scala b/test/uk/gov/hmrc/merchandiseinbaggage/service/TestAuditConnector.scala deleted file mode 100644 index 61547abb4..000000000 --- a/test/uk/gov/hmrc/merchandiseinbaggage/service/TestAuditConnector.scala +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2024 HM Revenue & Customs - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package uk.gov.hmrc.merchandiseinbaggage.service - -import org.apache.pekko.actor.ActorSystem -import org.apache.pekko.stream.Materializer -import play.api.inject.{ApplicationLifecycle, DefaultApplicationLifecycle} -import play.api.libs.json.JsValue -import uk.gov.hmrc.audit.HandlerResult -import uk.gov.hmrc.play.audit.http.config.AuditingConfig -import uk.gov.hmrc.play.audit.http.connector.{AuditChannel, AuditConnector, DatastreamMetrics} - -import scala.concurrent.{ExecutionContext, Future} - -abstract class TestAuditConnector(appName: String) extends AuditConnector { - private val _auditingConfig = - AuditingConfig(consumer = None, enabled = true, auditSource = "", auditSentHeaders = false) - - override def auditingConfig: AuditingConfig = _auditingConfig - - override def auditChannel: AuditChannel = new AuditChannel { - override def auditingConfig: AuditingConfig = _auditingConfig - - override def materializer: Materializer = Materializer(ActorSystem()) - - override def lifecycle: ApplicationLifecycle = new DefaultApplicationLifecycle() - - override def send(path: String, event: JsValue)(implicit ec: ExecutionContext): Future[HandlerResult] = { - sendResult(path, event) - Future.successful(HandlerResult.Success) - } - - override def datastreamMetrics: DatastreamMetrics = DatastreamMetrics.disabled - } - - override def datastreamMetrics: DatastreamMetrics = DatastreamMetrics.disabled - - def sendResult(path: String, event: JsValue): Future[HandlerResult] - -} From 6af448f8eb26646a18aa858afe69b18a00e4df35 Mon Sep 17 00:00:00 2001 From: robpetterson Date: Fri, 21 Jun 2024 09:19:15 +0100 Subject: [PATCH 3/9] DDCE-5464:removed comments --- app/assets/stylesheets/application.scss | 3 -- conf/logback.xml | 54 ------------------------- 2 files changed, 57 deletions(-) delete mode 100644 conf/logback.xml diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 3a177796c..438645ace 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,7 +1,4 @@ -//$govuk-assets-path: "/declare-commercial-goods/assets/lib/govuk-frontend/govuk/assets/"; -$hmrc-assets-path: "/declare-commercial-goods/assets/lib/hmrc-frontend/hmrc/"; -//@import "lib/govuk-frontend/govuk/all"; @import "lib/govuk-frontend/dist/govuk/all"; @import "lib/hmrc-frontend/hmrc/all"; @import "autocomplete"; diff --git a/conf/logback.xml b/conf/logback.xml deleted file mode 100644 index fde986f87..000000000 --- a/conf/logback.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - logs/merchandise-in-baggage-frontend.log - - %date{ISO8601} level=[%level] logger=[%logger] thread=[%thread] message=[%message] %replace(exception=[%xException]){'^exception=\[\]$',''}%n - - - - - - %date{ISO8601} level=[%level] logger=[%logger] thread=[%thread] rid=[%X{X-Request-ID}] user=[%X{Authorization}] message=[%message] %replace(exception=[%xException]){'^exception=\[\]$',''}%n - - - - - logs/access.log - - %message%n - - - - - logs/connector.log - - %message%n - - - - - - - - - - - - - - - - - - - - - - - - - - - From fe571ef71b90fbb7ed615a73d25e04e45265058d Mon Sep 17 00:00:00 2001 From: robpetterson Date: Fri, 21 Jun 2024 09:35:19 +0100 Subject: [PATCH 4/9] DDCE-5464:removed access-log-file and reverted asset paths --- app/assets/stylesheets/application.scss | 2 ++ conf/logback.xml | 35 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 conf/logback.xml diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 438645ace..6dce494c7 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,3 +1,5 @@ +$govuk-assets-path: "/declare-commercial-goods/assets/lib/govuk-frontend/govuk/assets/"; +$hmrc-assets-path: "/declare-commercial-goods/assets/lib/hmrc-frontend/hmrc/"; @import "lib/govuk-frontend/dist/govuk/all"; @import "lib/hmrc-frontend/hmrc/all"; diff --git a/conf/logback.xml b/conf/logback.xml new file mode 100644 index 000000000..8b2ec8c11 --- /dev/null +++ b/conf/logback.xml @@ -0,0 +1,35 @@ + + + + + logs/merchandise-in-baggage-frontend.log + + %date{ISO8601} level=[%level] logger=[%logger] thread=[%thread] message=[%message] %replace(exception=[%xException]){'^exception=\[\]$',''}%n + + + + + + %date{ISO8601} level=[%level] logger=[%logger] thread=[%thread] rid=[%X{X-Request-ID}] user=[%X{Authorization}] message=[%message] %replace(exception=[%xException]){'^exception=\[\]$',''}%n + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 11a2a12de003b5e97c588e57162d0e6804b49082 Mon Sep 17 00:00:00 2001 From: robpetterson Date: Fri, 21 Jun 2024 10:07:04 +0100 Subject: [PATCH 5/9] DDCE-5464:removed ACCESS_LOG_FILE --- conf/logback.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/conf/logback.xml b/conf/logback.xml index 8b2ec8c11..282fa6229 100644 --- a/conf/logback.xml +++ b/conf/logback.xml @@ -14,6 +14,13 @@ + + logs/connector.log + + %message%n + + + From 858379e8ab99fabc2436e93db87734ac370512ad Mon Sep 17 00:00:00 2001 From: robpetterson Date: Mon, 1 Jul 2024 09:01:43 +0100 Subject: [PATCH 6/9] DDCE-5464:Changes as per Taiwos comments in PR --- app/assets/javascripts/html5shiv.min.js | 4 -- app/assets/stylesheets/application-ie-8.scss | 3 -- app/assets/stylesheets/application.scss | 3 +- .../CheckYourAnswersExportView.scala.html | 13 +++---- .../CheckYourAnswersImportView.scala.html | 13 +++---- .../views/Head.scala.html | 23 ------------ .../views/Layout.scala.html | 19 ++++++---- .../PurchaseDetailsExportView.scala.html | 18 ++++----- .../views/layouts/govukLayout.scala.html | 9 +---- project/AppDependencies.scala | 4 +- .../service/AuditorSpec.scala | 37 ------------------- 11 files changed, 34 insertions(+), 112 deletions(-) delete mode 100644 app/assets/javascripts/html5shiv.min.js delete mode 100644 app/assets/stylesheets/application-ie-8.scss delete mode 100644 app/uk/gov/hmrc/merchandiseinbaggage/views/Head.scala.html diff --git a/app/assets/javascripts/html5shiv.min.js b/app/assets/javascripts/html5shiv.min.js deleted file mode 100644 index 355afd106..000000000 --- a/app/assets/javascripts/html5shiv.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/** -* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed -*/ -!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document); \ No newline at end of file diff --git a/app/assets/stylesheets/application-ie-8.scss b/app/assets/stylesheets/application-ie-8.scss deleted file mode 100644 index 92b8053bf..000000000 --- a/app/assets/stylesheets/application-ie-8.scss +++ /dev/null @@ -1,3 +0,0 @@ -$govuk-is-ie8: true; -@import "application"; -@import "language-selection"; \ No newline at end of file diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 6dce494c7..6fa0d73b2 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,5 +1,4 @@ -$govuk-assets-path: "/declare-commercial-goods/assets/lib/govuk-frontend/govuk/assets/"; -$hmrc-assets-path: "/declare-commercial-goods/assets/lib/hmrc-frontend/hmrc/"; +$hmrc-assets-path: "/declare-commercial-goods/assets/lib/hmrc-frontend/dist/hmrc/"; @import "lib/govuk-frontend/dist/govuk/all"; @import "lib/hmrc-frontend/hmrc/all"; diff --git a/app/uk/gov/hmrc/merchandiseinbaggage/views/CheckYourAnswersExportView.scala.html b/app/uk/gov/hmrc/merchandiseinbaggage/views/CheckYourAnswersExportView.scala.html index 482193d1d..00a78bfb8 100644 --- a/app/uk/gov/hmrc/merchandiseinbaggage/views/CheckYourAnswersExportView.scala.html +++ b/app/uk/gov/hmrc/merchandiseinbaggage/views/CheckYourAnswersExportView.scala.html @@ -22,7 +22,7 @@ @import uk.gov.hmrc.merchandiseinbaggage.utils.DateUtils._ @import uk.gov.hmrc.merchandiseinbaggage.controllers.DeclarationJourneyRequest -@this(layout: Layout, formHelper: FormWithCSRF, errorSummary: components.errorSummary, summaryList: includes.goodsSummary, button: components.button) +@this(layout: Layout, govukWarningText: GovukWarningText, formHelper: FormWithCSRF, errorSummary: components.errorSummary, summaryList: includes.goodsSummary, button: components.button) @(form: Form[_], declaration: Declaration, isAgent: YesNo)(implicit request: DeclarationJourneyRequest[_], messages: Messages, appConfig: AppConfig) @@ -186,13 +186,10 @@

@messages(s"checkYourAnswers.${agentOrTrader}.sendDe

@messages("checkYourAnswers.sendDeclaration.confirm")

-
- - - @messages("checkYourAnswers.sendDeclaration.warning") - @messages(s"checkYourAnswers.sendDeclaration.warning.Export.${agentOrTrader}.message") - -
+@govukWarningText(WarningText( +iconFallbackText = Some(messages("checkYourAnswers.sendDeclaration.warning")), +content = Text(messages(s"checkYourAnswers.sendDeclaration.warning.Export.${agentOrTrader}.message")) +)) @button(messages("checkYourAnswers.makeDeclarationButton"), name = Some("makeDeclarationButton")) } diff --git a/app/uk/gov/hmrc/merchandiseinbaggage/views/CheckYourAnswersImportView.scala.html b/app/uk/gov/hmrc/merchandiseinbaggage/views/CheckYourAnswersImportView.scala.html index a19acd1be..a881a41e3 100644 --- a/app/uk/gov/hmrc/merchandiseinbaggage/views/CheckYourAnswersImportView.scala.html +++ b/app/uk/gov/hmrc/merchandiseinbaggage/views/CheckYourAnswersImportView.scala.html @@ -25,7 +25,7 @@ @import uk.gov.hmrc.merchandiseinbaggage.utils.DataModelEnriched._ @import uk.gov.hmrc.merchandiseinbaggage.controllers.DeclarationJourneyRequest -@this(layout: Layout, formHelper: FormWithCSRF, errorSummary: components.errorSummary, summaryList: includes.goodsSummary, button: components.button) +@this(layout: Layout, govukWarningText: GovukWarningText, formHelper: FormWithCSRF, errorSummary: components.errorSummary, summaryList: includes.goodsSummary, button: components.button) @(form: Form[_], declaration: Declaration, calculationResults: CalculationResults, isAgent: YesNo)(implicit request: DeclarationJourneyRequest[_], messages: Messages, appConfig: AppConfig) @@ -198,13 +198,10 @@

@messages(s"checkYourAnswers.${agentOrTrader}.sendDe

@messages("checkYourAnswers.sendDeclaration.confirm")

-
- - - @messages("checkYourAnswers.sendDeclaration.warning") - @messages(s"checkYourAnswers.sendDeclaration.warning.Import.${agentOrTrader}.message") - -
+@govukWarningText(WarningText( +iconFallbackText = Some(messages("checkYourAnswers.sendDeclaration.warning")), +content = Text(messages(s"checkYourAnswers.sendDeclaration.warning.Import.${agentOrTrader}.message")) +)) diff --git a/app/uk/gov/hmrc/merchandiseinbaggage/views/Head.scala.html b/app/uk/gov/hmrc/merchandiseinbaggage/views/Head.scala.html deleted file mode 100644 index 018f8708f..000000000 --- a/app/uk/gov/hmrc/merchandiseinbaggage/views/Head.scala.html +++ /dev/null @@ -1,23 +0,0 @@ -@* - * Copyright 2024 HM Revenue & Customs - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *@ - -@this() - -@(headBlock: Option[Html] = None) -@headBlock - - - diff --git a/app/uk/gov/hmrc/merchandiseinbaggage/views/Layout.scala.html b/app/uk/gov/hmrc/merchandiseinbaggage/views/Layout.scala.html index 7088cf77f..caf030cd2 100644 --- a/app/uk/gov/hmrc/merchandiseinbaggage/views/Layout.scala.html +++ b/app/uk/gov/hmrc/merchandiseinbaggage/views/Layout.scala.html @@ -15,15 +15,17 @@ *@ @import views.html.helper.CSPNonce -@import uk.gov.hmrc.merchandiseinbaggage.views.html.{Head, layouts} +@import uk.gov.hmrc.merchandiseinbaggage.views.html.layouts @import uk.gov.hmrc.merchandiseinbaggage.config.AppConfig @import uk.gov.hmrc.merchandiseinbaggage.model.api.DeclarationType @import uk.gov.hmrc.hmrcfrontend.views.html.components._ +@import uk.gov.hmrc.hmrcfrontend.views.html.helpers._ @import uk.gov.hmrc.merchandiseinbaggage.controllers.routes._ @this( govukLayout: layouts.govukLayout, - head: Head, + hmrcHead: HmrcHead, + hmrcScripts: HmrcScripts, hmrcTimeoutDialog: HmrcTimeoutDialog ) @@ -38,6 +40,8 @@ @defaultHead = { @headBlock + + @{if(timeOut) hmrcTimeoutDialog(TimeoutDialog( timeout= Some(appConfig.timeout), countdown= Some(appConfig.countdown), @@ -61,18 +65,17 @@ @defaultScripts = { - - + @scriptsBlock } @if(isAssistedDigital) { @govukLayout( pageTitle = pageTitle, - headBlock = Some(head(Some(defaultHead))), - scriptsBlock = Some(defaultScripts), + headBlock = Some(hmrcHead(headBlock = Some(defaultHead))), + scriptsBlock = Some(hmrcScripts(scriptsBlock = Some(defaultScripts))), beforeContentBlock = None, maybeBackButtonUrl = maybeBackButtonUrl, declarationType = None, @@ -81,8 +84,8 @@ } else { @govukLayout( pageTitle = pageTitle, - headBlock = Some(head(Some(defaultHead))), - scriptsBlock = Some(defaultScripts), + headBlock = Some(hmrcHead(headBlock = Some(defaultHead))), + scriptsBlock = Some(hmrcScripts(scriptsBlock = Some(defaultScripts))), beforeContentBlock = None, maybeBackButtonUrl = maybeBackButtonUrl, declarationType = maybeDeclarationType, diff --git a/app/uk/gov/hmrc/merchandiseinbaggage/views/PurchaseDetailsExportView.scala.html b/app/uk/gov/hmrc/merchandiseinbaggage/views/PurchaseDetailsExportView.scala.html index 7c38993ad..8b4cad5ca 100644 --- a/app/uk/gov/hmrc/merchandiseinbaggage/views/PurchaseDetailsExportView.scala.html +++ b/app/uk/gov/hmrc/merchandiseinbaggage/views/PurchaseDetailsExportView.scala.html @@ -17,18 +17,14 @@ @import uk.gov.hmrc.merchandiseinbaggage.views.html.{Layout, components} @import uk.gov.hmrc.merchandiseinbaggage.controllers.routes._ @import uk.gov.hmrc.merchandiseinbaggage.model.core.PurchaseDetailsInput -@import uk.gov.hmrc.hmrcfrontend.views.html.components.HmrcCurrencyInput @import uk.gov.hmrc.merchandiseinbaggage.model.api.DeclarationType.Export -@import uk.gov.hmrc.hmrcfrontend.views.Aliases.CurrencyInput @import uk.gov.hmrc.merchandiseinbaggage.controllers.DeclarationGoodsRequest @this( +govukInput: GovukInput, layout: Layout, formHelper: FormWithCSRF, -h1: components.h1, errorSummary: components.errorSummary, -text: components.inputText, -currencyInput: HmrcCurrencyInput, button: components.button ) @@ -50,11 +46,15 @@

@messages("purchaseDetails.type.of.goods") @goodsCategory
- @currencyInput( - CurrencyInput( - id = "price", name = "price", + @govukInput( + Input( + id = "price", + name = "price", classes = "govuk-input--width-10", - value = form("price").value + value = form("price").value, + prefix = Some(PrefixOrSuffix( + content = Text("£") + )) ) ) diff --git a/app/uk/gov/hmrc/merchandiseinbaggage/views/layouts/govukLayout.scala.html b/app/uk/gov/hmrc/merchandiseinbaggage/views/layouts/govukLayout.scala.html index bf560bc59..be1a9afaa 100644 --- a/app/uk/gov/hmrc/merchandiseinbaggage/views/layouts/govukLayout.scala.html +++ b/app/uk/gov/hmrc/merchandiseinbaggage/views/layouts/govukLayout.scala.html @@ -30,7 +30,6 @@ govukBackLink: GovukBackLink, languageSelection: components.languageSelection, hmrcReportTechnicalIssueHelper: HmrcReportTechnicalIssueHelper, - hmrcTrackingConsentSnippet: HmrcTrackingConsentSnippet, hmrcStandardFooter: HmrcStandardFooter, govukSkipLink: GovukSkipLink, siteHeader: components.siteHeader, @@ -48,12 +47,6 @@ isAssistedDigital: Boolean )(contentBlock: Html)(implicit messages: Messages, request: Request[_]) -@headDefault = { -@headBlock -@hmrcTrackingConsentSnippet() -} - - @headerDefault = { @if(isAssistedDigital) { @siteHeader() @@ -119,7 +112,7 @@ @govukTemplate( htmlLang = Some(messages.lang.code), pageTitle = pageTitle, - headBlock = Some(headDefault), + headBlock = headBlock, headerBlock = headerDefault, beforeContentBlock = Some(beforeContentDefault), footerBlock = hmrcStandardFooter(), diff --git a/project/AppDependencies.scala b/project/AppDependencies.scala index b613c2d90..5a9a0734d 100644 --- a/project/AppDependencies.scala +++ b/project/AppDependencies.scala @@ -12,12 +12,12 @@ object AppDependencies { "org.webjars.npm" % "accessible-autocomplete" % "2.0.4", "com.softwaremill.quicklens" %% "quicklens" % "1.9.7", "org.typelevel" %% "cats-core" % "2.12.0", - "io.github.samueleresca" %% "pekko-quartz-scheduler" % "1.2.0-pekko-1.0.x" + "io.github.samueleresca" %% "pekko-quartz-scheduler" % "1.2.1-pekko-1.0.x" ) private val test: Seq[ModuleID] = Seq( "uk.gov.hmrc" %% "bootstrap-test-play-30" % bootstrapVersion, - "org.scalatestplus" %% "scalacheck-1-17" % "3.2.18.0" + "org.scalatestplus" %% "scalacheck-1-18" % "3.2.18.0" ).map(_ % Test) // only add additional dependencies here - it test inherit test dependencies above already diff --git a/test/uk/gov/hmrc/merchandiseinbaggage/service/AuditorSpec.scala b/test/uk/gov/hmrc/merchandiseinbaggage/service/AuditorSpec.scala index 8c09208f7..24dc7daca 100644 --- a/test/uk/gov/hmrc/merchandiseinbaggage/service/AuditorSpec.scala +++ b/test/uk/gov/hmrc/merchandiseinbaggage/service/AuditorSpec.scala @@ -20,16 +20,10 @@ import org.mockito.ArgumentMatchers.any import org.mockito.Mockito.{mock, when} import org.scalatest.concurrent.ScalaFutures import play.api.i18n.MessagesApi -import play.api.libs.json.JsValue -import play.api.libs.json.Json.toJson -import play.api.mvc.RequestHeader -import uk.gov.hmrc.audit.HandlerResult import uk.gov.hmrc.http.HeaderCarrier -import uk.gov.hmrc.merchandiseinbaggage.model.api.Declaration import uk.gov.hmrc.merchandiseinbaggage.{BaseSpec, CoreTestData} import uk.gov.hmrc.play.audit.http.connector.AuditConnector import uk.gov.hmrc.play.audit.http.connector.AuditResult.{Disabled, Failure, Success} -import uk.gov.hmrc.play.audit.model.ExtendedDataEvent import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.Future @@ -59,36 +53,5 @@ class AuditorSpec extends BaseSpec with CoreTestData with ScalaFutures { } } - "use DeclarationPaymentAttempted event for amendments" in { - val aDeclarationWithAmendment: Declaration = declaration.copy(amendments = List(aAmendment)) - - val mockAuditConnector: AuditConnector = mock(classOf[AuditConnector]) - - when(mockAuditConnector.sendExtendedEvent(any())(any(), any())) - .thenReturn(Future.successful(Success)) - - val auditService: Auditor = new Auditor { - override val auditConnector: AuditConnector = mockAuditConnector - override val messagesApi: MessagesApi = aMessagesApi - } - - auditService.auditDeclaration(aDeclarationWithAmendment).futureValue mustBe a[Unit] - } - - "handle auditConnector failure" in { - val aDeclarationWithAmendment: Declaration = declaration.copy(amendments = List(aAmendment)) - - val mockAuditConnector: AuditConnector = mock(classOf[AuditConnector]) - - when(mockAuditConnector.sendExtendedEvent(any())(any(), any())) - .thenReturn(Future.successful(Success)) - - val auditService: Auditor = new Auditor { - override val auditConnector: AuditConnector = mockAuditConnector - override val messagesApi: MessagesApi = aMessagesApi - } - - auditService.auditDeclaration(aDeclarationWithAmendment).futureValue mustBe a[Unit] - } } } From 0ffddd59146f73d3401610bc0fd7b2a114de477b Mon Sep 17 00:00:00 2001 From: robpetterson Date: Mon, 1 Jul 2024 10:40:53 +0100 Subject: [PATCH 7/9] DCCE-5464:added correct govuk path --- app/assets/stylesheets/application.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 6fa0d73b2..7c4ddbdd9 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,3 +1,5 @@ +$govuk-assets-path: "/declare-commercial-goods/assets/lib/govuk-frontend/dist/govuk/assets/"; +$hmrc-assets-path: "/declare-commercial-goods/assets/lib/hmrc-frontend/hmrc/"; $hmrc-assets-path: "/declare-commercial-goods/assets/lib/hmrc-frontend/dist/hmrc/"; @import "lib/govuk-frontend/dist/govuk/all"; From 45996af203f2c97f1131966591bc5f8ad42d8e00 Mon Sep 17 00:00:00 2001 From: robpetterson Date: Mon, 1 Jul 2024 11:39:47 +0100 Subject: [PATCH 8/9] DDCE-5464: Corrected gouk assets paths --- app/assets/stylesheets/application.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 7c4ddbdd9..e5bce3c75 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,6 +1,5 @@ $govuk-assets-path: "/declare-commercial-goods/assets/lib/govuk-frontend/dist/govuk/assets/"; $hmrc-assets-path: "/declare-commercial-goods/assets/lib/hmrc-frontend/hmrc/"; -$hmrc-assets-path: "/declare-commercial-goods/assets/lib/hmrc-frontend/dist/hmrc/"; @import "lib/govuk-frontend/dist/govuk/all"; @import "lib/hmrc-frontend/hmrc/all"; From d5a6427009dfad32c0e433665781d06d20b1bce1 Mon Sep 17 00:00:00 2001 From: robpetterson Date: Mon, 1 Jul 2024 12:41:34 +0100 Subject: [PATCH 9/9] DDCE-5464: updated dep version --- project/AppDependencies.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/AppDependencies.scala b/project/AppDependencies.scala index 5a9a0734d..ed9ac9587 100644 --- a/project/AppDependencies.scala +++ b/project/AppDependencies.scala @@ -17,7 +17,7 @@ object AppDependencies { private val test: Seq[ModuleID] = Seq( "uk.gov.hmrc" %% "bootstrap-test-play-30" % bootstrapVersion, - "org.scalatestplus" %% "scalacheck-1-18" % "3.2.18.0" + "org.scalatestplus" %% "scalacheck-1-18" % "3.2.19.0" ).map(_ % Test) // only add additional dependencies here - it test inherit test dependencies above already