diff --git a/.secrets.baseline b/.secrets.baseline index a0604fa3c..fccb846ec 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -150,7 +150,7 @@ "filename": "src/test/java/uk/gov/pay/ledger/pact/ContractTest.java", "hashed_secret": "fa143a7a660dac99bd4755c518d72306ad2df9d1", "is_verified": false, - "line_number": 792 + "line_number": 817 } ], "src/test/java/uk/gov/pay/ledger/rule/PostgresTestDocker.java": [ @@ -163,5 +163,5 @@ } ] }, - "generated_at": "2024-11-27T09:58:15Z" + "generated_at": "2024-12-18T09:23:59Z" } diff --git a/src/test/java/uk/gov/pay/ledger/pact/ContractTest.java b/src/test/java/uk/gov/pay/ledger/pact/ContractTest.java index 66a61940b..4f1dfdeb8 100644 --- a/src/test/java/uk/gov/pay/ledger/pact/ContractTest.java +++ b/src/test/java/uk/gov/pay/ledger/pact/ContractTest.java @@ -34,6 +34,8 @@ import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric; import static org.junit.platform.commons.util.StringUtils.isBlank; import static uk.gov.pay.ledger.event.model.ResourceType.AGREEMENT; +import static uk.gov.pay.ledger.transaction.model.Exemption3ds.EXEMPTION_HONOURED; +import static uk.gov.pay.ledger.transaction.model.Exemption3dsRequested.CORPORATE; import static uk.gov.pay.ledger.util.DatabaseTestHelper.aDatabaseTestHelper; import static uk.gov.pay.ledger.util.fixture.EventFixture.anEventFixture; import static uk.gov.pay.ledger.util.fixture.PayoutFixture.PayoutFixtureBuilder.aPayoutFixture; @@ -266,6 +268,29 @@ public void createTransactionWithFeeAndNetAmount(Map params) { .insert(app.getJdbi()); } + @State("a transaction with honoured corporate exemption exists") + public void createTransactionWith3dsExemption(Map params) { + String transactionExternalId = params.get("charge_id"); + String gatewayAccountId = params.get("account_id"); + + if (isBlank(transactionExternalId)) { + transactionExternalId = "ch_123abc456xyz"; + } + if (isBlank(gatewayAccountId)) { + gatewayAccountId = "123456"; + } + + aTransactionFixture() + .withExternalId(transactionExternalId) + .withGatewayAccountId(gatewayAccountId) + .withState(TransactionState.SUCCESS) + .withAmount(100L) + .withExemption3ds(EXEMPTION_HONOURED) + .withExemption3dsRequested(CORPORATE) + .withDefaultTransactionDetails() + .insert(app.getJdbi()); + } + @State("a transaction with delayed capture true exists") public void createTransactionWithDelayedCapture(Map params) { String transactionExternalId = params.get("charge_id"); diff --git a/src/test/java/uk/gov/pay/ledger/pact/SelfServiceContractTest.java b/src/test/java/uk/gov/pay/ledger/pact/SelfServiceContractTest.java index 31f097dec..e6ad5f0b9 100644 --- a/src/test/java/uk/gov/pay/ledger/pact/SelfServiceContractTest.java +++ b/src/test/java/uk/gov/pay/ledger/pact/SelfServiceContractTest.java @@ -1,5 +1,6 @@ package uk.gov.pay.ledger.pact; +import au.com.dius.pact.provider.junit.IgnoreNoPactsToVerify; import au.com.dius.pact.provider.junit.PactRunner; import au.com.dius.pact.provider.junit.Provider; import au.com.dius.pact.provider.junit.loader.PactBroker; @@ -11,5 +12,6 @@ @PactBroker(scheme = "https", host = "${PACT_BROKER_HOST:pact-broker.deploy.payments.service.gov.uk}", tags = {"${PACT_CONSUMER_TAG}", "test-fargate"}, authentication = @PactBrokerAuth(username = "${PACT_BROKER_USERNAME}", password = "${PACT_BROKER_PASSWORD}"), consumers = {"selfservice"}) +@IgnoreNoPactsToVerify public class SelfServiceContractTest extends ContractTest { }