diff --git a/test/uk/gov/hmrc/cataloguefrontend/ServicePageSpec.scala b/test/uk/gov/hmrc/cataloguefrontend/ServicePageSpec.scala index a32291906..e1347fd24 100644 --- a/test/uk/gov/hmrc/cataloguefrontend/ServicePageSpec.scala +++ b/test/uk/gov/hmrc/cataloguefrontend/ServicePageSpec.scala @@ -56,6 +56,7 @@ class ServicePageSpec extends UnitSpec with GuiceOneServerPerSuite with WireMock override def beforeEach(): Unit = { super.beforeEach() + FeatureSwitch.disable(CatalogueFrontendSwitches.indicators) serviceEndpoint(GET, "/reports/repositories", willRespondWith = (200, Some("[]"))) serviceEndpoint(GET, "/frontend-route/service-1", willRespondWith = (200, Some(configServiceService1))) serviceEndpoint(GET, "/frontend-route/service-name", willRespondWith = (200, Some(configServiceService1))) @@ -258,6 +259,7 @@ class ServicePageSpec extends UnitSpec with GuiceOneServerPerSuite with WireMock } "Render a message if the indicators service returns 404" in { + FeatureSwitch.enable(CatalogueFrontendSwitches.indicators) val today = LocalDateTime.now val dayInterval = createdAt.until(today, ChronoUnit.DAYS) + 1 @@ -277,6 +279,7 @@ class ServicePageSpec extends UnitSpec with GuiceOneServerPerSuite with WireMock } "Render a message if the indicators service encounters an error" in { + FeatureSwitch.enable(CatalogueFrontendSwitches.indicators) serviceEndpoint(GET, "/api/repositories/service-name", willRespondWith = (200, Some(serviceDetailsData))) serviceEndpoint(GET, "/api/indicators/service/service-name/deployments", willRespondWith = (500, None)) serviceEndpoint( diff --git a/test/uk/gov/hmrc/cataloguefrontend/TeamServicesSpec.scala b/test/uk/gov/hmrc/cataloguefrontend/TeamServicesSpec.scala index 56d5e0dbe..99eac6836 100644 --- a/test/uk/gov/hmrc/cataloguefrontend/TeamServicesSpec.scala +++ b/test/uk/gov/hmrc/cataloguefrontend/TeamServicesSpec.scala @@ -68,6 +68,7 @@ class TeamServicesSpec extends UnitSpec with BeforeAndAfter with GuiceOneServerP override def beforeEach(): Unit = { super.beforeEach() + FeatureSwitch.disable(CatalogueFrontendSwitches.indicators) serviceEndpoint(GET, "/reports/repositories", willRespondWith = (200, Some("[]"))) serviceEndpoint(GET, "/api/teams/teamA/dependencies", willRespondWith = (200, Some("[]"))) serviceEndpoint(GET, "/api/teams/CATO/dependencies", willRespondWith = (200, Some("[]"))) diff --git a/test/uk/gov/hmrc/cataloguefrontend/connector/LeakDetectionConnectorSpec.scala b/test/uk/gov/hmrc/cataloguefrontend/connector/LeakDetectionConnectorSpec.scala index fd6d249de..3bafb8206 100644 --- a/test/uk/gov/hmrc/cataloguefrontend/connector/LeakDetectionConnectorSpec.scala +++ b/test/uk/gov/hmrc/cataloguefrontend/connector/LeakDetectionConnectorSpec.scala @@ -18,15 +18,15 @@ package uk.gov.hmrc.cataloguefrontend.connector import org.mockito.Matchers._ import org.mockito.Mockito._ -import org.scalatest._ -import org.scalatest.concurrent.ScalaFutures import org.scalatest.mockito.MockitoSugar import uk.gov.hmrc.http.{BadGatewayException, HeaderCarrier} import uk.gov.hmrc.play.bootstrap.config.ServicesConfig import uk.gov.hmrc.play.bootstrap.http.HttpClient +import uk.gov.hmrc.play.test.UnitSpec + import scala.concurrent.{ExecutionContext, Future} -class LeakDetectionConnectorSpec extends WordSpec with Matchers with ScalaFutures with MockitoSugar { +class LeakDetectionConnectorSpec extends UnitSpec with MockitoSugar { import ExecutionContext.Implicits.global "repositoriesWithLeaks" should { @@ -42,7 +42,7 @@ class LeakDetectionConnectorSpec extends WordSpec with Matchers with ScalaFuture val leakDetectionConnector = new LeakDetectionConnector(httpClient, servicesConfig) - leakDetectionConnector.repositoriesWithLeaks.futureValue shouldBe Seq.empty + await( leakDetectionConnector.repositoriesWithLeaks ) shouldBe Seq.empty } } }