diff --git a/src/main/play-25/uk/gov/hmrc/play/config/TrackingConsentConfig.scala b/src/main/play-25/uk/gov/hmrc/play/config/TrackingConsentConfig.scala index 212c7444..5ad15d49 100644 --- a/src/main/play-25/uk/gov/hmrc/play/config/TrackingConsentConfig.scala +++ b/src/main/play-25/uk/gov/hmrc/play/config/TrackingConsentConfig.scala @@ -23,7 +23,7 @@ class TrackingConsentConfig @Inject()(config: Configuration) { val platformHost: Option[String] = config.getString("platform.frontend.host") val trackingConsentHost: Option[String] = - platformHost.orElse(config.getString("tracking-consent-frontend.host")) + platformHost.map(_ => "").orElse(config.getString("tracking-consent-frontend.host")) val trackingConsentPath: Option[String] = config.getString("tracking-consent-frontend.path") val optimizelyGtmPath: Option[String] = diff --git a/src/main/play-26/uk/gov/hmrc/play/config/TrackingConsentConfig.scala b/src/main/play-26/uk/gov/hmrc/play/config/TrackingConsentConfig.scala index ed693dc5..339414a6 100644 --- a/src/main/play-26/uk/gov/hmrc/play/config/TrackingConsentConfig.scala +++ b/src/main/play-26/uk/gov/hmrc/play/config/TrackingConsentConfig.scala @@ -23,7 +23,7 @@ class TrackingConsentConfig @Inject()(config: Configuration) { val platformHost: Option[String] = config.getOptional[String]("platform.frontend.host") val trackingConsentHost: Option[String] = - platformHost.orElse(config.getOptional[String]("tracking-consent-frontend.host")) + platformHost.map(_ => "").orElse(config.getOptional[String]("tracking-consent-frontend.host")) val trackingConsentPath: Option[String] = config.getOptional[String]("tracking-consent-frontend.path") val optimizelyGtmPath: Option[String] = diff --git a/src/test/scala/uk/gov/hmrc/play/views/config/TrackingConsentConfigSpec.scala b/src/test/scala/uk/gov/hmrc/play/views/config/TrackingConsentConfigSpec.scala index 0253e730..2d2b94ab 100644 --- a/src/test/scala/uk/gov/hmrc/play/views/config/TrackingConsentConfigSpec.scala +++ b/src/test/scala/uk/gov/hmrc/play/views/config/TrackingConsentConfigSpec.scala @@ -49,7 +49,7 @@ class TrackingConsentConfigSpec extends WordSpec with Matchers { "tracking-consent-frontend.gtm.container" -> "a" )) val config = application.injector.instanceOf[TrackingConsentConfig] - config.url should equal(Some("https://www.tax.service.gov.uk/tracking-consent/tracking.js")) + config.url should equal(Some("/tracking-consent/tracking.js")) } "return None if an tracking-consent-frontend.gtm.container does not exist in application.conf" in { @@ -78,8 +78,7 @@ class TrackingConsentConfigSpec extends WordSpec with Matchers { "tracking-consent-frontend.gtm.container" -> "a" )) val config = application.injector.instanceOf[TrackingConsentConfig] - config.optimizelyGtmUrl should equal( - Some("https://www.tax.service.gov.uk/tracking-consent/tracking/optimizely.js")) + config.optimizelyGtmUrl should equal(Some("/tracking-consent/tracking/optimizely.js")) } "return None if an tracking-consent-frontend.gtm.container does not exist in application.conf" in {