From 1516084aae4cb1482f3cbd4cdfb5104c108e90ff Mon Sep 17 00:00:00 2001 From: Vincent Vinnicombe <5462800+vinnicombe@users.noreply.github.com> Date: Tue, 30 Apr 2024 12:09:02 +0100 Subject: [PATCH 1/5] DDCNL-8910: Hiding UR banner and removing unused tests and config, wip --- .../hmrc/nisp/config/ApplicationConfig.scala | 2 -- app/uk/gov/hmrc/nisp/views/Main.scala | 2 +- .../hmrc/nisp/views/excluded_ni.scala.html | 7 ++-- .../hmrc/nisp/views/excluded_sp.scala.html | 7 ++-- conf/application.conf | 6 +--- .../uk/gov/hmrc/nisp/views/MainViewSpec.scala | 32 ------------------- .../hmrc/nisp/views/NIRecordViewSpec.scala | 7 +--- .../nisp/views/StatePensionViewSpec.scala | 8 +---- .../views/TermsAndConditionsViewSpec.scala | 2 +- 9 files changed, 11 insertions(+), 62 deletions(-) diff --git a/app/uk/gov/hmrc/nisp/config/ApplicationConfig.scala b/app/uk/gov/hmrc/nisp/config/ApplicationConfig.scala index 470efb9f..2cfeba1b 100644 --- a/app/uk/gov/hmrc/nisp/config/ApplicationConfig.scala +++ b/app/uk/gov/hmrc/nisp/config/ApplicationConfig.scala @@ -38,7 +38,6 @@ class ApplicationConfig @Inject()(config: Configuration, servicesConfig: Service val mfaUpliftUrl: String = getString("mfa-uplift.url") val ggSignInUrl: String = getString("government-gateway-sign-in.host") - val showUrBanner: Boolean = getBoolean("urBannerToggle") val showExcessiveTrafficMessage: Boolean = getBoolean("excessiveTrafficToggle") val isleManLink: String = getString("isle-man-link.url") val citizenAdviceLinkEn: String = getString("citizens-advice-link-en.url") @@ -48,7 +47,6 @@ class ApplicationConfig @Inject()(config: Configuration, servicesConfig: Service val pensionWiseLink: String = getString("pension-wise-link.url") private val frontendHost = getString("nisp-frontend.host") val accessibilityStatementHost: String = getString("accessibility-statement.url") + "/accessibility-statement" - val urRecruitmentLinkURL: String = getString("ur-research.url") val showFullNI: Boolean = getConfBool("features.fullNIrecord", false) val futureProofPersonalMax: Boolean = getConfBool("features.future-proof.personalMax", false) diff --git a/app/uk/gov/hmrc/nisp/views/Main.scala b/app/uk/gov/hmrc/nisp/views/Main.scala index 12434d17..52d6a076 100644 --- a/app/uk/gov/hmrc/nisp/views/Main.scala +++ b/app/uk/gov/hmrc/nisp/views/Main.scala @@ -37,7 +37,7 @@ import scala.util.{Failure, Success, Try} trait Main { def apply( pageTitle: String, - showUrBanner: Boolean = true, + showUrBanner: Boolean = false, extendedTitle: Boolean = true, optCustomLayout: Option[Html => Html] = None, sidebar: Option[Html] = None, diff --git a/app/uk/gov/hmrc/nisp/views/excluded_ni.scala.html b/app/uk/gov/hmrc/nisp/views/excluded_ni.scala.html index 9599fec3..599c3067 100644 --- a/app/uk/gov/hmrc/nisp/views/excluded_ni.scala.html +++ b/app/uk/gov/hmrc/nisp/views/excluded_ni.scala.html @@ -33,9 +33,9 @@ request: ExcludedAuthenticatedRequest[_] ) -@excludeUrPanel(showUrBannerOn: Exclusion) = @{ +@*excludeUrPanel(showUrBannerOn: Exclusion) = @{ showUrBannerOn == PostStatePensionAge | showUrBannerOn == IsleOfMan -} +}*@ @insetContent = { @if(exclusion.equals(IsleOfMan)) { @@ -48,8 +48,7 @@ } @main( - pageTitle = messages("nisp.main.title"), - showUrBanner = excludeUrPanel(exclusion) + pageTitle = messages("nisp.main.title") ) { @h1( elmId = Some("mainTitle"), diff --git a/app/uk/gov/hmrc/nisp/views/excluded_sp.scala.html b/app/uk/gov/hmrc/nisp/views/excluded_sp.scala.html index c225527d..6a86f7fb 100644 --- a/app/uk/gov/hmrc/nisp/views/excluded_sp.scala.html +++ b/app/uk/gov/hmrc/nisp/views/excluded_sp.scala.html @@ -46,9 +46,9 @@ statePensionAgeUnderConsideration: Option[Boolean] )(implicit messages: Messages, request: ExcludedAuthenticatedRequest[_]) -@excludeUrPanel(showUrBannerOn: Exclusion) = @{ +@*excludeUrPanel(showUrBannerOn: Exclusion) = @{ showUrBannerOn == PostStatePensionAge | showUrBannerOn == IsleOfMan -} +}*@ @insetContent = { @if(exclusion.equals(PostStatePensionAge)) { @@ -84,8 +84,7 @@ } @main( - pageTitle = messages("nisp.main.title"), - showUrBanner = excludeUrPanel(exclusion) + pageTitle = messages("nisp.main.title") ) { @h1( diff --git a/conf/application.conf b/conf/application.conf index 62593b84..08d305e5 100644 --- a/conf/application.conf +++ b/conf/application.conf @@ -34,7 +34,7 @@ application.session.httpOnly = true play.i18n.langCookieHttpOnly = true play.i18n.langs = ["en", "cy"] -urBannerToggle = true +urBannerToggle = false excessiveTrafficToggle = false numberOfPayableTaxYears = 18 @@ -145,10 +145,6 @@ microservice { serviceUrl = "/check-your-state-pension/account" -ur-research { - url = "https://signup.take-part-in-research.service.gov.uk/?utm_campaign=checkyourstatepensionPTA&utm_source=Other&utm_medium=other&t=HMRC&id=183" -} - government-gateway-sign-in { host = "http://localhost:9949/auth-login-stub/gg-sign-in" } diff --git a/test/uk/gov/hmrc/nisp/views/MainViewSpec.scala b/test/uk/gov/hmrc/nisp/views/MainViewSpec.scala index fe8f2322..2ec83fd0 100644 --- a/test/uk/gov/hmrc/nisp/views/MainViewSpec.scala +++ b/test/uk/gov/hmrc/nisp/views/MainViewSpec.scala @@ -33,9 +33,6 @@ class MainViewSpec extends HtmlSpec { val testName: String val profileAndSettingsLink: String - val researchBannerHeaderSelector: String - val researchBannerLinkSelector: String - val accessibilityReferrerUrl: String val reportTechnicalProblemUrl: String @@ -45,9 +42,6 @@ class MainViewSpec extends HtmlSpec { override val testName: String = "new style" override val profileAndSettingsLink: String = "http://localhost:9232/personal-account/profile-and-settings" - override val researchBannerHeaderSelector: String = ".hmrc-user-research-banner__title" - override val researchBannerLinkSelector: String = ".hmrc-user-research-banner__link" - override val accessibilityReferrerUrl: String = "12346%2Fcheck-your-state-pension" override val reportTechnicalProblemUrl: String = "http://localhost:9250/contact/report-technical-problem?newTab=true&service=NISP&referrerUrl=%2Fsome-url" @@ -188,32 +182,6 @@ class MainViewSpec extends HtmlSpec { } - "the research banner" should { - - lazy val researchBanner = doc.select(".hmrc-user-research-banner").first() - - "have the text 'Help make GOV.UK better'" in { - val text = researchBanner.select(testObject.uniqueValues.researchBannerHeaderSelector).text() - - text shouldBe CommonValues.urBannerHeader - } - - "have the link 'Sign up to take part in research (opens in new tab)'" which { - - lazy val link = researchBanner.select(testObject.uniqueValues.researchBannerLinkSelector) - - "has the correct text" in { - link.text() shouldBe CommonValues.urBannerLinkText - } - - "links to the correct URL" in { - link.attr("href") shouldBe CommonValues.urBannerLink - } - - } - - } - "js scripts" should { def scripts: Elements = doc.getElementsByTag("script") diff --git a/test/uk/gov/hmrc/nisp/views/NIRecordViewSpec.scala b/test/uk/gov/hmrc/nisp/views/NIRecordViewSpec.scala index 873b89d8..ccaf9b45 100644 --- a/test/uk/gov/hmrc/nisp/views/NIRecordViewSpec.scala +++ b/test/uk/gov/hmrc/nisp/views/NIRecordViewSpec.scala @@ -110,7 +110,7 @@ class NIRecordViewSpec extends HtmlSpec with Injecting with WireMockHelper { val nIRecordRegular: NationalInsuranceRecord = TestAccountBuilder .jsonResponseByType[NationalInsuranceRecord](TestAccountBuilder.regularNino, "national-insurance-record") - def mockSetup: OngoingStubbing[String] = { + def mockSetup: OngoingStubbing[Future[Either[UpstreamErrorResponse, Either[StatePensionExclusionFilter, NationalInsuranceRecord]]]] = { when(mockDateProvider.currentDate).thenReturn(LocalDate.of(2016, 9, 9)) when(mockAppConfig.showFullNI).thenReturn(true) @@ -141,11 +141,6 @@ class NIRecordViewSpec extends HtmlSpec with Injecting with WireMockHelper { val niRecord = nIRecordRegular.copy(qualifyingYearsPriorTo1975 = -3) when(mockNationalInsuranceService.getSummary(mockAny())(mockAny())). thenReturn(Future.successful(Right(Right(niRecord)))) - - when(mockAppConfig.showUrBanner).thenReturn(true) - when(mockAppConfig.urBannerUrl).thenReturn( - "https://signup.take-part-in-research.service.gov.uk/?utm_campaign=checkyourstatepensionPTA&utm_source=Other&utm_medium=other&t=HMRC&id=183" - ) } def mockViewPayableGapsFeatureFlag(enabled: Boolean) = { when(mockFeatureFlagService.get(ViewPayableGapsToggle)) diff --git a/test/uk/gov/hmrc/nisp/views/StatePensionViewSpec.scala b/test/uk/gov/hmrc/nisp/views/StatePensionViewSpec.scala index 58a5da2d..1f405fb0 100644 --- a/test/uk/gov/hmrc/nisp/views/StatePensionViewSpec.scala +++ b/test/uk/gov/hmrc/nisp/views/StatePensionViewSpec.scala @@ -44,9 +44,6 @@ import scala.concurrent.Future class StatePensionViewSpec extends HtmlSpec with Injecting with WireMockHelper { - val urResearchURL = - "https://signup.take-part-in-research.service.gov.uk/?utm_campaign=checkyourstatepensionPTA&utm_source=Other&utm_medium=other&t=HMRC&id=183" - val fakeRequest: FakeRequest[AnyContentAsEmpty.type] = FakeRequest() val mockAuditConnector: AuditConnector = mock[AuditConnector] @@ -92,7 +89,6 @@ class StatePensionViewSpec extends HtmlSpec with Injecting with WireMockHelper { reset(mockPertaxHelper) server.resetAll() when(mockPertaxHelper.isFromPertax(any())).thenReturn(Future.successful(false)) - when(mockAppConfig.urBannerUrl).thenReturn(urResearchURL) when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") when(mockAppConfig.pertaxAuthBaseUrl).thenReturn(s"http://localhost:${server.port()}") @@ -113,7 +109,7 @@ class StatePensionViewSpec extends HtmlSpec with Injecting with WireMockHelper { "The scenario is continue working || Fill Gaps" when { "State Pension view with NON-MQP : Personal Max" should { - def mockSetup: OngoingStubbing[String] = { + def mockSetup: OngoingStubbing[Future[Either[UpstreamErrorResponse, Either[StatePensionExclusionFilter, NationalInsuranceRecord]]]] = { when(mockStatePensionService.getSummary(any())(any())) .thenReturn(Future.successful(Right(Right(StatePension( LocalDate.of(2016, 4, 5), @@ -154,8 +150,6 @@ class StatePensionViewSpec extends HtmlSpec with Injecting with WireMockHelper { ) )))) - when(mockAppConfig.showUrBanner).thenReturn(true) - when(mockAppConfig.urRecruitmentLinkURL).thenReturn(urResearchURL) } lazy val doc = diff --git a/test/uk/gov/hmrc/nisp/views/TermsAndConditionsViewSpec.scala b/test/uk/gov/hmrc/nisp/views/TermsAndConditionsViewSpec.scala index d6514c1e..48cca272 100644 --- a/test/uk/gov/hmrc/nisp/views/TermsAndConditionsViewSpec.scala +++ b/test/uk/gov/hmrc/nisp/views/TermsAndConditionsViewSpec.scala @@ -49,7 +49,7 @@ class TermsAndConditionsViewSpec extends HtmlSpec with Injecting { } "assert correct heading level 2 on page" in { - val title = source.getElementsByTag("h2").get(1).toString + val title = source.getElementsByTag("h2").get(0).toString title should include(messages("nisp.tandcs.heading")) } } From 11f60d6a8da722d1b741ce399de3cfeac0fba81d Mon Sep 17 00:00:00 2001 From: Vincent Vinnicombe <5462800+vinnicombe@users.noreply.github.com> Date: Tue, 30 Apr 2024 14:36:58 +0100 Subject: [PATCH 2/5] DDCNL-8910: Removed ur banner config --- app/uk/gov/hmrc/nisp/config/ApplicationConfig.scala | 1 - conf/application.conf | 4 ---- 2 files changed, 5 deletions(-) diff --git a/app/uk/gov/hmrc/nisp/config/ApplicationConfig.scala b/app/uk/gov/hmrc/nisp/config/ApplicationConfig.scala index 2cfeba1b..d741007a 100644 --- a/app/uk/gov/hmrc/nisp/config/ApplicationConfig.scala +++ b/app/uk/gov/hmrc/nisp/config/ApplicationConfig.scala @@ -52,7 +52,6 @@ class ApplicationConfig @Inject()(config: Configuration, servicesConfig: Service val futureProofPersonalMax: Boolean = getConfBool("features.future-proof.personalMax", false) val isWelshEnabled: Boolean = getConfBool("features.welsh-translation", false) val feedbackFrontendUrl: String = getString("feedback-frontend.url") - val urBannerUrl: String = getString("urBanner.link") val niRecordPayableYears: Int = getInt("numberOfPayableTaxYears") val friendlyUsers: Seq[String] = config.get[Seq[String]]("allowedUsers.friendly") val allowedUsersEndOfNino: Seq[String] = config.get[Seq[String]]("allowedUsers.endOfNino") diff --git a/conf/application.conf b/conf/application.conf index 08d305e5..3d556b4d 100644 --- a/conf/application.conf +++ b/conf/application.conf @@ -39,10 +39,6 @@ excessiveTrafficToggle = false numberOfPayableTaxYears = 18 -urBanner { - link = "https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=checkyourstatepensionPTA&utm_source=Other&utm_medium=other&t=HMRC&id=183" -} - mongodb { uri = "mongodb://localhost:27017/"${appName} timeToLiveInSeconds = 3600 From f22cf07a3fec8698d8885986b92024f49df2f2d2 Mon Sep 17 00:00:00 2001 From: Vincent Vinnicombe <5462800+vinnicombe@users.noreply.github.com> Date: Wed, 1 May 2024 15:24:35 +0100 Subject: [PATCH 3/5] DDCNL-8910: Test app conf updates... --- .../controllers/LandingControllerSpec.scala | 3 --- .../controllers/NIRecordControllerSpec.scala | 7 ------ .../StatePensionControllerSpec.scala | 22 +++++++++---------- .../TermsConditionsControllerSpec.scala | 1 - .../nisp/errorHandler/ErrorHandlerSpec.scala | 1 - .../views/ExclusionCopeFailedNIViewSpec.scala | 3 --- .../views/ExclusionCopeFailedSPViewSpec.scala | 3 --- .../nisp/views/ExclusionCopeNIViewSpec.scala | 3 --- .../nisp/views/ExclusionCopeSPViewSpec.scala | 3 --- .../hmrc/nisp/views/ExclusionViewSpec.scala | 3 --- .../views/StatePension_CopeViewSpec.scala | 4 ---- .../nisp/views/StatePension_MQPViewSpec.scala | 3 --- 12 files changed, 11 insertions(+), 45 deletions(-) diff --git a/test/uk/gov/hmrc/nisp/controllers/LandingControllerSpec.scala b/test/uk/gov/hmrc/nisp/controllers/LandingControllerSpec.scala index 75e147b9..d79c84f1 100644 --- a/test/uk/gov/hmrc/nisp/controllers/LandingControllerSpec.scala +++ b/test/uk/gov/hmrc/nisp/controllers/LandingControllerSpec.scala @@ -39,8 +39,6 @@ class LandingControllerSpec extends UnitSpec with BeforeAndAfterEach with GuiceO implicit val fakeRequest: FakeRequest[AnyContentAsEmpty.type] = FakeRequest("GET", "/") val fakeRequestWelsh: FakeRequest[AnyContentAsEmpty.type] = FakeRequest("GET", "/cymraeg") - val urResearchURL = - "https://signup.take-part-in-research.service.gov.uk/?utm_campaign=checkyourstatepensionPTA&utm_source=Other&utm_medium=other&t=HMRC&id=183" val mockApplicationConfig: ApplicationConfig = mock[ApplicationConfig] val mockIVConnector: IdentityVerificationConnector = mock[IdentityVerificationConnector] @@ -55,7 +53,6 @@ class LandingControllerSpec extends UnitSpec with BeforeAndAfterEach with GuiceO super.beforeEach() reset(mockApplicationConfig) reset(mockIVConnector) - when(mockApplicationConfig.urBannerUrl).thenReturn(urResearchURL) when(mockApplicationConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockApplicationConfig.contactFormServiceIdentifier).thenReturn("/id") } diff --git a/test/uk/gov/hmrc/nisp/controllers/NIRecordControllerSpec.scala b/test/uk/gov/hmrc/nisp/controllers/NIRecordControllerSpec.scala index e9baffb8..2ad89108 100644 --- a/test/uk/gov/hmrc/nisp/controllers/NIRecordControllerSpec.scala +++ b/test/uk/gov/hmrc/nisp/controllers/NIRecordControllerSpec.scala @@ -66,7 +66,6 @@ class NIRecordControllerSpec extends UnitSpec with GuiceOneAppPerSuite with Inje reset(mockAuditConnector) reset(mockDateProvider) reset(mockFeatureFlagService) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") server.resetAll() @@ -1208,7 +1207,6 @@ class NIRecordControllerSpec extends UnitSpec with GuiceOneAppPerSuite with Inje Future.successful(Right(Right(expectedNationalInsuranceRecord))) ) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") @@ -1237,7 +1235,6 @@ class NIRecordControllerSpec extends UnitSpec with GuiceOneAppPerSuite with Inje Future.successful(Right(Right(expectedNationalInsuranceRecord))) ) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") @@ -1279,7 +1276,6 @@ class NIRecordControllerSpec extends UnitSpec with GuiceOneAppPerSuite with Inje Future.successful(Right(Right(expectedNationalInsuranceRecord))) ) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") @@ -1294,7 +1290,6 @@ class NIRecordControllerSpec extends UnitSpec with GuiceOneAppPerSuite with Inje Future.successful(Left(UpstreamErrorResponse("test", 500))) ) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") @@ -1308,7 +1303,6 @@ class NIRecordControllerSpec extends UnitSpec with GuiceOneAppPerSuite with Inje Future.successful(Right(Left(StatePensionExclusionFiltered(Exclusion.Dead)))) ) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") @@ -1320,7 +1314,6 @@ class NIRecordControllerSpec extends UnitSpec with GuiceOneAppPerSuite with Inje "GET /account/nirecord/voluntarycontribs" should { "return how to check page for authenticated user" in { - when(mockAppConfig.urBannerUrl).thenReturn("/foo") when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") diff --git a/test/uk/gov/hmrc/nisp/controllers/StatePensionControllerSpec.scala b/test/uk/gov/hmrc/nisp/controllers/StatePensionControllerSpec.scala index 67bb322b..3d6103f3 100644 --- a/test/uk/gov/hmrc/nisp/controllers/StatePensionControllerSpec.scala +++ b/test/uk/gov/hmrc/nisp/controllers/StatePensionControllerSpec.scala @@ -244,7 +244,7 @@ class StatePensionControllerSpec extends UnitSpec with BeforeAndAfterEach with G Future.successful(Right(Right(statePensionResponse))) ) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") + when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") @@ -299,7 +299,7 @@ class StatePensionControllerSpec extends UnitSpec with BeforeAndAfterEach with G Future.successful(Right(Right(statePensionCopeResponse))) ) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") + when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") @@ -314,7 +314,7 @@ class StatePensionControllerSpec extends UnitSpec with BeforeAndAfterEach with G Future.successful(Right(Right(statePensionCopeResponse))) ) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") + when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") @@ -333,7 +333,7 @@ class StatePensionControllerSpec extends UnitSpec with BeforeAndAfterEach with G Future.successful(Right(Right(statePensionResponse))) ) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") + when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") @@ -354,7 +354,7 @@ class StatePensionControllerSpec extends UnitSpec with BeforeAndAfterEach with G Future.successful(Right(Left(StatePensionExclusionFiltered(Exclusion.MarriedWomenReducedRateElection)))) ) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") + when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") @@ -374,7 +374,7 @@ class StatePensionControllerSpec extends UnitSpec with BeforeAndAfterEach with G Future.successful(Right(Right(statePensionResponse))) ) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") + when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") @@ -396,7 +396,7 @@ class StatePensionControllerSpec extends UnitSpec with BeforeAndAfterEach with G Future.successful(Right(Right(statePensionResponse))) ) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") + when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") @@ -441,7 +441,7 @@ class StatePensionControllerSpec extends UnitSpec with BeforeAndAfterEach with G Future.successful(Right(Right(statePensionVariation2))) ) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") + when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") @@ -465,7 +465,7 @@ class StatePensionControllerSpec extends UnitSpec with BeforeAndAfterEach with G Future.successful(Right(Right(statePensionResponseVariation3))) ) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") + when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") @@ -527,7 +527,7 @@ class StatePensionControllerSpec extends UnitSpec with BeforeAndAfterEach with G Future.successful(Right(Right(statePensionResponseVariation3))) ) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") + when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") @@ -552,7 +552,7 @@ class StatePensionControllerSpec extends UnitSpec with BeforeAndAfterEach with G Future.successful(Right(Right(statePensionResponseVariation3))) ) - when(mockAppConfig.urBannerUrl).thenReturn("/foo") + when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") diff --git a/test/uk/gov/hmrc/nisp/controllers/TermsConditionsControllerSpec.scala b/test/uk/gov/hmrc/nisp/controllers/TermsConditionsControllerSpec.scala index dafeeeda..1d87f76c 100644 --- a/test/uk/gov/hmrc/nisp/controllers/TermsConditionsControllerSpec.scala +++ b/test/uk/gov/hmrc/nisp/controllers/TermsConditionsControllerSpec.scala @@ -42,7 +42,6 @@ class TermsConditionsControllerSpec extends UnitSpec with GuiceOneAppPerSuite wi override def beforeEach(): Unit = { super.beforeEach() - when(mockApplicationConfig.urBannerUrl).thenReturn("/urResearch") when(mockApplicationConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockApplicationConfig.contactFormServiceIdentifier).thenReturn("/id") } diff --git a/test/uk/gov/hmrc/nisp/errorHandler/ErrorHandlerSpec.scala b/test/uk/gov/hmrc/nisp/errorHandler/ErrorHandlerSpec.scala index 72115fa1..199d1343 100644 --- a/test/uk/gov/hmrc/nisp/errorHandler/ErrorHandlerSpec.scala +++ b/test/uk/gov/hmrc/nisp/errorHandler/ErrorHandlerSpec.scala @@ -52,7 +52,6 @@ class ErrorHandlerSpec extends UnitSpec with GuiceOneAppPerSuite with Injecting override def beforeEach(): Unit = { super.beforeEach() - when(mockApplicationConfig.urBannerUrl).thenReturn("/urResearch") when(mockApplicationConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockApplicationConfig.contactFormServiceIdentifier).thenReturn("/id") when(mockApplicationConfig.showExcessiveTrafficMessage).thenReturn(false) diff --git a/test/uk/gov/hmrc/nisp/views/ExclusionCopeFailedNIViewSpec.scala b/test/uk/gov/hmrc/nisp/views/ExclusionCopeFailedNIViewSpec.scala index 2683b4aa..a0a291c3 100644 --- a/test/uk/gov/hmrc/nisp/views/ExclusionCopeFailedNIViewSpec.scala +++ b/test/uk/gov/hmrc/nisp/views/ExclusionCopeFailedNIViewSpec.scala @@ -35,8 +35,6 @@ import java.time.{Instant, LocalDate} class ExclusionCopeFailedNIViewSpec extends HtmlSpec with Injecting { val mockAppConfig: ApplicationConfig = mock[ApplicationConfig] - val urResearchURL = - "https://signup.take-part-in-research.service.gov.uk/?utm_campaign=checkyourstatepensionPTA&utm_source=Other&utm_medium=other&t=HMRC&id=183" implicit val fakeRequest: ExcludedAuthenticatedRequest[AnyContentAsEmpty.type] = ExcludedAuthenticatedRequest( FakeRequest(), @@ -46,7 +44,6 @@ class ExclusionCopeFailedNIViewSpec extends HtmlSpec with Injecting { override def beforeEach(): Unit = { super.beforeEach() - when(mockAppConfig.urBannerUrl).thenReturn(urResearchURL) when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") } diff --git a/test/uk/gov/hmrc/nisp/views/ExclusionCopeFailedSPViewSpec.scala b/test/uk/gov/hmrc/nisp/views/ExclusionCopeFailedSPViewSpec.scala index 4d004ad4..ba2324d1 100644 --- a/test/uk/gov/hmrc/nisp/views/ExclusionCopeFailedSPViewSpec.scala +++ b/test/uk/gov/hmrc/nisp/views/ExclusionCopeFailedSPViewSpec.scala @@ -36,8 +36,6 @@ import java.time.{Instant, LocalDate} class ExclusionCopeFailedSPViewSpec extends HtmlSpec with Injecting { val mockAppConfig: ApplicationConfig = mock[ApplicationConfig] - val urResearchURL = - "https://signup.take-part-in-research.service.gov.uk/?utm_campaign=checkyourstatepensionPTA&utm_source=Other&utm_medium=other&t=HMRC&id=183" implicit val fakeRequest: ExcludedAuthenticatedRequest[AnyContentAsEmpty.type] = ExcludedAuthenticatedRequest( FakeRequest(), @@ -47,7 +45,6 @@ class ExclusionCopeFailedSPViewSpec extends HtmlSpec with Injecting { override def beforeEach(): Unit = { super.beforeEach() - when(mockAppConfig.urBannerUrl).thenReturn(urResearchURL) when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") } diff --git a/test/uk/gov/hmrc/nisp/views/ExclusionCopeNIViewSpec.scala b/test/uk/gov/hmrc/nisp/views/ExclusionCopeNIViewSpec.scala index 0a11b297..7fa8092d 100644 --- a/test/uk/gov/hmrc/nisp/views/ExclusionCopeNIViewSpec.scala +++ b/test/uk/gov/hmrc/nisp/views/ExclusionCopeNIViewSpec.scala @@ -34,8 +34,6 @@ import java.time.{Instant, LocalDate} class ExclusionCopeNIViewSpec extends HtmlSpec with Injecting { val mockAppConfig: ApplicationConfig = mock[ApplicationConfig] - val urResearchURL = - "https://signup.take-part-in-research.service.gov.uk/?utm_campaign=checkyourstatepensionPTA&utm_source=Other&utm_medium=other&t=HMRC&id=183" implicit val fakeRequest: ExcludedAuthenticatedRequest[AnyContentAsEmpty.type] = ExcludedAuthenticatedRequest( FakeRequest(), @@ -45,7 +43,6 @@ class ExclusionCopeNIViewSpec extends HtmlSpec with Injecting { override def beforeEach(): Unit = { super.beforeEach() - when(mockAppConfig.urBannerUrl).thenReturn(urResearchURL) when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") } diff --git a/test/uk/gov/hmrc/nisp/views/ExclusionCopeSPViewSpec.scala b/test/uk/gov/hmrc/nisp/views/ExclusionCopeSPViewSpec.scala index 9eb2775b..ae027811 100644 --- a/test/uk/gov/hmrc/nisp/views/ExclusionCopeSPViewSpec.scala +++ b/test/uk/gov/hmrc/nisp/views/ExclusionCopeSPViewSpec.scala @@ -34,8 +34,6 @@ import java.time.{Instant, LocalDate} class ExclusionCopeSPViewSpec extends HtmlSpec with Injecting { val mockAppConfig: ApplicationConfig = mock[ApplicationConfig] - val urResearchURL = - "https://signup.take-part-in-research.service.gov.uk/?utm_campaign=checkyourstatepensionPTA&utm_source=Other&utm_medium=other&t=HMRC&id=183" implicit val fakeRequest: ExcludedAuthenticatedRequest[AnyContentAsEmpty.type] = ExcludedAuthenticatedRequest( FakeRequest(), @@ -45,7 +43,6 @@ class ExclusionCopeSPViewSpec extends HtmlSpec with Injecting { override def beforeEach(): Unit = { super.beforeEach() - when(mockAppConfig.urBannerUrl).thenReturn(urResearchURL) when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") } diff --git a/test/uk/gov/hmrc/nisp/views/ExclusionViewSpec.scala b/test/uk/gov/hmrc/nisp/views/ExclusionViewSpec.scala index 3829cbf0..8c47a7a2 100644 --- a/test/uk/gov/hmrc/nisp/views/ExclusionViewSpec.scala +++ b/test/uk/gov/hmrc/nisp/views/ExclusionViewSpec.scala @@ -35,8 +35,6 @@ import java.time.{Instant, LocalDate} class ExclusionViewSpec extends HtmlSpec with Injecting { val mockAppConfig: ApplicationConfig = mock[ApplicationConfig] - val urResearchURL = - "https://signup.take-part-in-research.service.gov.uk/?utm_campaign=checkyourstatepensionPTA&utm_source=Other&utm_medium=other&t=HMRC&id=183" implicit val fakeRequest: ExcludedAuthenticatedRequest[AnyContentAsEmpty.type] = ExcludedAuthenticatedRequest( FakeRequest(), @@ -48,7 +46,6 @@ class ExclusionViewSpec extends HtmlSpec with Injecting { override def beforeEach(): Unit = { super.beforeEach() - when(mockAppConfig.urBannerUrl).thenReturn(urResearchURL) when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") } diff --git a/test/uk/gov/hmrc/nisp/views/StatePension_CopeViewSpec.scala b/test/uk/gov/hmrc/nisp/views/StatePension_CopeViewSpec.scala index 5a106695..e50e173e 100644 --- a/test/uk/gov/hmrc/nisp/views/StatePension_CopeViewSpec.scala +++ b/test/uk/gov/hmrc/nisp/views/StatePension_CopeViewSpec.scala @@ -71,9 +71,6 @@ class StatePension_CopeViewSpec extends HtmlSpec with ScalaFutures with Injectin val mockMetricsService: MetricsService = mock[MetricsService] val mockSessionCache: SessionCache = mock[SessionCache] - val urResearchURL = - "https://signup.take-part-in-research.service.gov.uk/?utm_campaign=checkyourstatepensionPTA&utm_source=Other&utm_medium=other&t=HMRC&id=183" - lazy val langUtils: LanguageUtils = inject[LanguageUtils] override def beforeEach(): Unit = { @@ -85,7 +82,6 @@ class StatePension_CopeViewSpec extends HtmlSpec with ScalaFutures with Injectin reset(mockPertaxHelper) server.resetAll() when(mockPertaxHelper.isFromPertax(any())).thenReturn(Future.successful(false)) - when(mockAppConfig.urBannerUrl).thenReturn(urResearchURL) when(mockAppConfig.accessibilityStatementUrl(any())).thenReturn("/foo") when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") diff --git a/test/uk/gov/hmrc/nisp/views/StatePension_MQPViewSpec.scala b/test/uk/gov/hmrc/nisp/views/StatePension_MQPViewSpec.scala index 8beda4b9..4f61775b 100644 --- a/test/uk/gov/hmrc/nisp/views/StatePension_MQPViewSpec.scala +++ b/test/uk/gov/hmrc/nisp/views/StatePension_MQPViewSpec.scala @@ -48,8 +48,6 @@ class StatePension_MQPViewSpec extends HtmlSpec with Injecting with WireMockHelp val expectedMoneyServiceLink = "https://www.moneyadviceservice.org.uk/en" val expectedPensionCreditOverviewLink = "https://www.gov.uk/pension-credit/overview" - val urResearchURL = - "https://signup.take-part-in-research.service.gov.uk/?utm_campaign=checkyourstatepensionPTA&utm_source=Other&utm_medium=other&t=HMRC&id=183" def generateFakeRequest: FakeRequest[AnyContentAsEmpty.type] = FakeRequest().withSession( SessionKeys.sessionId -> s"session-${UUID.randomUUID()}", @@ -99,7 +97,6 @@ class StatePension_MQPViewSpec extends HtmlSpec with Injecting with WireMockHelp reset(mockAppConfig) reset(mockPertaxHelper) when(mockPertaxHelper.isFromPertax(any())).thenReturn(Future.successful(false)) - when(mockAppConfig.urBannerUrl).thenReturn(urResearchURL) when(mockAppConfig.accessibilityStatementUrl(any())).thenReturn("/foo") when(mockAppConfig.reportAProblemNonJSUrl).thenReturn("/reportAProblem") when(mockAppConfig.contactFormServiceIdentifier).thenReturn("/id") From 5bde8456e5d310d805bbbb2cf007d13146fc5900 Mon Sep 17 00:00:00 2001 From: Vincent Vinnicombe <5462800+vinnicombe@users.noreply.github.com> Date: Thu, 2 May 2024 08:03:23 +0100 Subject: [PATCH 4/5] DDCNL-8910: Updates as per PR bot comment --- test/resources/application.conf | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/resources/application.conf b/test/resources/application.conf index 1b39fc2b..c655e7b4 100644 --- a/test/resources/application.conf +++ b/test/resources/application.conf @@ -16,5 +16,3 @@ include "/conf/application.conf" play.cache.bindCaches = ["controller-cache", "document-cache"] play.cache.createBoundCaches = false - -metrics.jvm = false From a3a1891e74cf5a347ebf987a4fd7439647047725 Mon Sep 17 00:00:00 2001 From: Vincent Vinnicombe <5462800+vinnicombe@users.noreply.github.com> Date: Fri, 3 May 2024 13:41:26 +0100 Subject: [PATCH 5/5] DDCNL-8910: Removed commented code and unused config --- app/uk/gov/hmrc/nisp/views/excluded_ni.scala.html | 4 ---- app/uk/gov/hmrc/nisp/views/excluded_sp.scala.html | 4 ---- conf/application.conf | 1 - 3 files changed, 9 deletions(-) diff --git a/app/uk/gov/hmrc/nisp/views/excluded_ni.scala.html b/app/uk/gov/hmrc/nisp/views/excluded_ni.scala.html index 599c3067..cfd64676 100644 --- a/app/uk/gov/hmrc/nisp/views/excluded_ni.scala.html +++ b/app/uk/gov/hmrc/nisp/views/excluded_ni.scala.html @@ -33,10 +33,6 @@ request: ExcludedAuthenticatedRequest[_] ) -@*excludeUrPanel(showUrBannerOn: Exclusion) = @{ - showUrBannerOn == PostStatePensionAge | showUrBannerOn == IsleOfMan -}*@ - @insetContent = { @if(exclusion.equals(IsleOfMan)) { @isleOfMan() diff --git a/app/uk/gov/hmrc/nisp/views/excluded_sp.scala.html b/app/uk/gov/hmrc/nisp/views/excluded_sp.scala.html index 6a86f7fb..6a18823e 100644 --- a/app/uk/gov/hmrc/nisp/views/excluded_sp.scala.html +++ b/app/uk/gov/hmrc/nisp/views/excluded_sp.scala.html @@ -46,10 +46,6 @@ statePensionAgeUnderConsideration: Option[Boolean] )(implicit messages: Messages, request: ExcludedAuthenticatedRequest[_]) -@*excludeUrPanel(showUrBannerOn: Exclusion) = @{ - showUrBannerOn == PostStatePensionAge | showUrBannerOn == IsleOfMan -}*@ - @insetContent = { @if(exclusion.equals(PostStatePensionAge)) { @postStatePensionAge() diff --git a/conf/application.conf b/conf/application.conf index 3d556b4d..9b4d2a74 100644 --- a/conf/application.conf +++ b/conf/application.conf @@ -34,7 +34,6 @@ application.session.httpOnly = true play.i18n.langCookieHttpOnly = true play.i18n.langs = ["en", "cy"] -urBannerToggle = false excessiveTrafficToggle = false numberOfPayableTaxYears = 18