Search in sources :

Example 1 with RefundSucceeded

use of uk.gov.pay.connector.events.model.refund.RefundSucceeded in project pay-connector by alphagov.

the class QueueMessageContractTest method verifyRefundedEvent.

@PactVerifyProvider("a refund succeeded message")
public String verifyRefundedEvent() throws JsonProcessingException {
    String gatewayTransactionId = RandomStringUtils.randomAlphanumeric(14);
    ChargeEntity chargeEntity = aValidChargeEntity().build();
    Charge charge = Charge.from(chargeEntity);
    RefundHistory refundHistory = aValidRefundHistoryEntity().withStatus(RefundStatus.REFUNDED.getValue()).withGatewayTransactionId(gatewayTransactionId).build();
    RefundSucceeded refundSucceeded = RefundSucceeded.from(charge, refundHistory);
    return refundSucceeded.toJsonString();
}
Also used : ChargeEntityFixture.aValidChargeEntity(uk.gov.pay.connector.charge.model.domain.ChargeEntityFixture.aValidChargeEntity) ChargeEntity(uk.gov.pay.connector.charge.model.domain.ChargeEntity) Charge(uk.gov.pay.connector.charge.model.domain.Charge) RefundSucceeded(uk.gov.pay.connector.events.model.refund.RefundSucceeded) RefundHistory(uk.gov.pay.connector.refund.model.domain.RefundHistory) PactVerifyProvider(au.com.dius.pact.provider.PactVerifyProvider)

Aggregations

PactVerifyProvider (au.com.dius.pact.provider.PactVerifyProvider)1 Charge (uk.gov.pay.connector.charge.model.domain.Charge)1 ChargeEntity (uk.gov.pay.connector.charge.model.domain.ChargeEntity)1 ChargeEntityFixture.aValidChargeEntity (uk.gov.pay.connector.charge.model.domain.ChargeEntityFixture.aValidChargeEntity)1 RefundSucceeded (uk.gov.pay.connector.events.model.refund.RefundSucceeded)1 RefundHistory (uk.gov.pay.connector.refund.model.domain.RefundHistory)1