From 1dcc8c74a304c67a812604c58f783a7e581d258f Mon Sep 17 00:00:00 2001 From: Sandor Arpa Date: Mon, 28 Sep 2020 17:36:04 +0100 Subject: [PATCH] PP-7211 refund needs a reel parent id - refund needs a real parent id not to break foreign key constrain --- src/test/java/uk/gov/pay/ledger/pact/ContractTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 3889ea98f..908760a59 100644 --- a/src/test/java/uk/gov/pay/ledger/pact/ContractTest.java +++ b/src/test/java/uk/gov/pay/ledger/pact/ContractTest.java @@ -17,6 +17,7 @@ import uk.gov.pay.ledger.transaction.search.model.RefundSummary; import uk.gov.pay.ledger.transaction.state.TransactionState; import uk.gov.pay.ledger.util.DatabaseTestHelper; +import uk.gov.pay.ledger.util.fixture.TransactionFixture; import java.time.ZonedDateTime; import java.util.Map; @@ -429,7 +430,7 @@ public void createThreePaymentsWithPaidoutDates(Map params) { String gatewayPayoutId3 = randomAlphanumeric(20); String gatewayPayoutId4 = randomAlphanumeric(20); - aTransactionFixture() + TransactionFixture refundParentFixture = aTransactionFixture() .withTransactionType("PAYMENT") .withGatewayAccountId(gatewayAccountId) .withGatewayPayoutId(gatewayPayoutId1) @@ -446,7 +447,7 @@ public void createThreePaymentsWithPaidoutDates(Map params) { .insert(app.getJdbi()); aTransactionFixture() .withTransactionType("REFUND") - .withParentExternalId(randomAlphanumeric(15)) + .withParentExternalId(refundParentFixture.getExternalId()) .withGatewayAccountId(gatewayAccountId) .withGatewayPayoutId(gatewayPayoutId4) .insert(app.getJdbi());