Skip to content

Commit

Permalink
Merge pull request #538 from hmrc/DDCNL-8910
Browse files Browse the repository at this point in the history
Ddcnl 8910
  • Loading branch information
vinnicombe authored May 3, 2024
2 parents 6ef32fe + a3a1891 commit 878f6db
Show file tree
Hide file tree
Showing 22 changed files with 17 additions and 118 deletions.
3 changes: 0 additions & 3 deletions app/uk/gov/hmrc/nisp/config/ApplicationConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -48,13 +47,11 @@ 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)
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")
Expand Down
2 changes: 1 addition & 1 deletion app/uk/gov/hmrc/nisp/views/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 1 addition & 6 deletions app/uk/gov/hmrc/nisp/views/excluded_ni.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
request: ExcludedAuthenticatedRequest[_]
)

@excludeUrPanel(showUrBannerOn: Exclusion) = @{
showUrBannerOn == PostStatePensionAge | showUrBannerOn == IsleOfMan
}

@insetContent = {
@if(exclusion.equals(IsleOfMan)) {
@isleOfMan()
Expand All @@ -48,8 +44,7 @@
}

@main(
pageTitle = messages("nisp.main.title"),
showUrBanner = excludeUrPanel(exclusion)
pageTitle = messages("nisp.main.title")
) {
@h1(
elmId = Some("mainTitle"),
Expand Down
7 changes: 1 addition & 6 deletions app/uk/gov/hmrc/nisp/views/excluded_sp.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -84,8 +80,7 @@
}

@main(
pageTitle = messages("nisp.main.title"),
showUrBanner = excludeUrPanel(exclusion)
pageTitle = messages("nisp.main.title")
) {

@h1(
Expand Down
9 changes: 0 additions & 9 deletions conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,10 @@ application.session.httpOnly = true
play.i18n.langCookieHttpOnly = true
play.i18n.langs = ["en", "cy"]

urBannerToggle = true
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
Expand Down Expand Up @@ -145,10 +140,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"
}
Expand Down
2 changes: 0 additions & 2 deletions test/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ include "/conf/application.conf"

play.cache.bindCaches = ["controller-cache", "document-cache"]
play.cache.createBoundCaches = false

metrics.jvm = false
3 changes: 0 additions & 3 deletions test/uk/gov/hmrc/nisp/controllers/LandingControllerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand All @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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")

Expand All @@ -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")

Expand All @@ -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")

Expand All @@ -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")

Expand Down
22 changes: 11 additions & 11 deletions test/uk/gov/hmrc/nisp/controllers/StatePensionControllerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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")

Expand All @@ -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")

Expand All @@ -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")

Expand All @@ -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")

Expand All @@ -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")

Expand All @@ -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")

Expand Down Expand Up @@ -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")

Expand All @@ -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")

Expand Down Expand Up @@ -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")

Expand All @@ -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")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
1 change: 0 additions & 1 deletion test/uk/gov/hmrc/nisp/errorHandler/ErrorHandlerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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")
}
Expand Down
3 changes: 0 additions & 3 deletions test/uk/gov/hmrc/nisp/views/ExclusionCopeNIViewSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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")
}
Expand Down
3 changes: 0 additions & 3 deletions test/uk/gov/hmrc/nisp/views/ExclusionCopeSPViewSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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")
}
Expand Down
3 changes: 0 additions & 3 deletions test/uk/gov/hmrc/nisp/views/ExclusionViewSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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")
}
Expand Down
Loading

0 comments on commit 878f6db

Please sign in to comment.