Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PP-13334 add pact state #3679

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -163,5 +163,5 @@
}
]
},
"generated_at": "2024-11-27T09:58:15Z"
"generated_at": "2024-12-18T09:23:59Z"
}
25 changes: 25 additions & 0 deletions src/test/java/uk/gov/pay/ledger/pact/ContractTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -266,6 +268,29 @@ public void createTransactionWithFeeAndNetAmount(Map<String, String> params) {
.insert(app.getJdbi());
}

@State("a transaction with honoured corporate exemption exists")
public void createTransactionWith3dsExemption(Map<String, String> 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<String, String> params) {
String transactionExternalId = params.get("charge_id");
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {
}
Loading