use of org.killbill.automaton.OperationException in project killbill by killbill.
the class TestPluginOperation method testOperationThrowsPaymentApiException.
@Test(groups = "fast")
public void testOperationThrowsPaymentApiException() throws Exception {
final CallbackTest callback = new CallbackTest(new PaymentApiException(ErrorCode.__UNKNOWN_ERROR_CODE));
final PaymentOperation pluginOperation = getPluginOperation();
try {
pluginOperation.dispatchWithAccountLockAndTimeout(PLUGIN_NAME_PLACEHOLDER, callback);
Assert.fail();
} catch (final OperationException e) {
Assert.assertEquals(e.getOperationResult(), OperationResult.EXCEPTION);
Assert.assertTrue(e.getCause() instanceof PaymentApiException);
}
}
Aggregations