use of org.killbill.billing.client.model.ComboPaymentTransaction in project killbill by killbill.
the class TestPayment method testComboAuthorizationAbortedPayment.
@Test(groups = "slow")
public void testComboAuthorizationAbortedPayment() throws Exception {
final Account accountJson = getAccount();
accountJson.setAccountId(null);
final String paymentExternalKey = UUID.randomUUID().toString();
final ComboPaymentTransaction comboPaymentTransaction = createComboPaymentTransaction(accountJson, paymentExternalKey);
mockPaymentControlProviderPlugin.setAborted(true);
try {
killBillClient.createPayment(comboPaymentTransaction, Arrays.asList(MockPaymentControlProviderPlugin.PLUGIN_NAME), ImmutableMap.<String, String>of(), requestOptions);
fail();
} catch (KillBillClientException e) {
assertEquals(e.getResponse().getStatusCode(), 422);
}
assertFalse(mockPaymentControlProviderPlugin.isOnFailureCallExecuted());
assertFalse(mockPaymentControlProviderPlugin.isOnSuccessCallExecuted());
}
Aggregations