@@ -20,6 +20,7 @@ import api.connectors.ConnectorSpec
2020import api .models .domain .{Nino , TaxYear }
2121import api .models .errors ._
2222import api .models .outcomes .ResponseWrapper
23+ import play .api .Configuration
2324import uk .gov .hmrc .http .StringContextOps
2425import v1 .models .request .delete .DeleteDisclosuresRequestData
2526
@@ -32,13 +33,15 @@ class DeleteDisclosuresConnectorSpec extends ConnectorSpec {
3233 " DeleteDisclosuresConnector" when {
3334 " a valid request is supplied" should {
3435 " return a successful response with the correct correlationId using IFS" in new Ifs1Test with Test {
36+ MockedAppConfig .featureSwitches returns Configuration (" ifs_hip_migration_1640.enabled" -> false )
3537 val expected : Right [Nothing , ResponseWrapper [Unit ]] = Right (ResponseWrapper (correlationId, ()))
3638
3739 willDelete(url " $baseUrl/income-tax/disclosures/ $nino/ $taxYear" ).returns(Future .successful(expected))
3840
3941 await(connector.deleteDisclosures(request)) shouldBe expected
4042 }
4143 " return a successful response with the correct correlationId using HIP" in new HipTest with Test {
44+ MockedAppConfig .featureSwitches returns Configuration (" ifs_hip_migration_1640.enabled" -> true )
4245 val expected : Right [Nothing , ResponseWrapper [Unit ]] = Right (ResponseWrapper (correlationId, ()))
4346
4447 willDelete(url " $baseUrl/itsd/disclosures/ $nino/ $taxYear" ).returns(Future .successful(expected))
@@ -49,13 +52,15 @@ class DeleteDisclosuresConnectorSpec extends ConnectorSpec {
4952
5053 " a request returning a single error" should {
5154 " return an unsuccessful response with the correct correlationId and a single error using IFS" in new Ifs1Test with Test {
55+ MockedAppConfig .featureSwitches returns Configuration (" ifs_hip_migration_1640.enabled" -> false )
5256 val expected : Left [ResponseWrapper [NinoFormatError .type ], Nothing ] = Left (ResponseWrapper (correlationId, NinoFormatError ))
5357
5458 willDelete(url " $baseUrl/income-tax/disclosures/ $nino/ $taxYear" ).returns(Future .successful(expected))
5559
5660 await(connector.deleteDisclosures(request)) shouldBe expected
5761 }
5862 " return an unsuccessful response with the correct correlationId and a single error using HIP" in new HipTest with Test {
63+ MockedAppConfig .featureSwitches returns Configuration (" ifs_hip_migration_1640.enabled" -> true )
5964 val expected : Left [ResponseWrapper [NinoFormatError .type ], Nothing ] = Left (ResponseWrapper (correlationId, NinoFormatError ))
6065
6166 willDelete(url " $baseUrl/itsd/disclosures/ $nino/ $taxYear" ).returns(Future .successful(expected))
@@ -66,6 +71,7 @@ class DeleteDisclosuresConnectorSpec extends ConnectorSpec {
6671
6772 " a request returning multiple errors" should {
6873 " return an unsuccessful response with the correct correlationId and multiple errors using IFS" in new Ifs1Test with Test {
74+ MockedAppConfig .featureSwitches returns Configuration (" ifs_hip_migration_1640.enabled" -> false )
6975 val expected : Left [ResponseWrapper [Seq [MtdError ]], Nothing ] =
7076 Left (ResponseWrapper (correlationId, Seq (NinoFormatError , InternalError , TaxYearFormatError )))
7177
@@ -74,6 +80,7 @@ class DeleteDisclosuresConnectorSpec extends ConnectorSpec {
7480 await(connector.deleteDisclosures(request)) shouldBe expected
7581 }
7682 " return an unsuccessful response with the correct correlationId and multiple errors using HIP" in new HipTest with Test {
83+ MockedAppConfig .featureSwitches returns Configuration (" ifs_hip_migration_1640.enabled" -> true )
7784 val expected : Left [ResponseWrapper [Seq [MtdError ]], Nothing ] =
7885 Left (ResponseWrapper (correlationId, Seq (NinoFormatError , InternalError , TaxYearFormatError )))
7986
0 commit comments