use of au.com.dius.pact.provider.PactVerifyProvider in project pay-connector by alphagov.
the class QueueMessageContractTest method verifyStatusCorrectedToCapturedToMatchGatewayStatusEvent.
@PactVerifyProvider("a status corrected to captured event")
public String verifyStatusCorrectedToCapturedToMatchGatewayStatusEvent() throws JsonProcessingException {
ChargeEntity chargeEntity = aValidChargeEntity().withStatus(ChargeStatus.CAPTURED).withFee(Fee.of(null, 42L)).build();
ChargeEventEntity chargeEventEntity = aValidChargeEventEntity().withCharge(chargeEntity).withGatewayEventDate(ZonedDateTime.now()).build();
StatusCorrectedToCapturedToMatchGatewayStatus event = new StatusCorrectedToCapturedToMatchGatewayStatus(chargeEventEntity.getChargeEntity().getServiceId(), chargeEventEntity.getChargeEntity().getGatewayAccount().isLive(), resourceId, CaptureConfirmedEventDetails.from(chargeEventEntity), ZonedDateTime.now());
return event.toJsonString();
}
use of au.com.dius.pact.provider.PactVerifyProvider in project customer-service by wenqiglantz.
the class CustomerEventsPublishPactVerificationTest method publishCustomerWasCreated.
@PactVerifyProvider("valid CustomerWasCreated from provider")
public String publishCustomerWasCreated() throws Exception {
CustomerInfo customerInfo = CustomerInfo.builder().customerId("595eed0c-eff5-4278-90ad-b952f18dbee8").firstName("test").lastName("last").build();
CustomerWasCreated event = CustomerWasCreated.builder().customerId("595eed0c-eff5-4278-90ad-b952f18dbee8").firstName("test").lastName("last").status(CustomerStatus.CREATED).build();
context.checking(new Expectations() {
{
oneOf(customerService).saveCustomer(customerInfo);
}
});
customerService.saveCustomer(customerInfo);
String eventString = objectMapper.writeValueAsString(event);
return eventString;
}
Aggregations