use of org.killbill.billing.beatrix.util.RefundChecker.ExpectedRefundCheck in project killbill by killbill.
the class TestPaymentRefund method testRefundWithInvoiceItemAdjustemts.
@Test(groups = "slow")
public void testRefundWithInvoiceItemAdjustemts() throws Exception {
final Map<UUID, BigDecimal> iias = new HashMap<UUID, BigDecimal>();
iias.put(invoice.getInvoiceItems().get(0).getId(), null);
refundPaymentWithInvoiceItemAdjAndCheckForCompletion(account, payment, iias, NextEvent.PAYMENT, NextEvent.INVOICE_PAYMENT, NextEvent.INVOICE_ADJUSTMENT);
refundChecker.checkRefund(payment.getId(), callContext, new ExpectedRefundCheck(payment.getId(), true, new BigDecimal("233.82"), Currency.USD, initialCreationDate.toLocalDate()));
invoice = invoiceChecker.checkInvoice(account.getId(), invoiceItemCount++, callContext, new ExpectedInvoiceItemCheck(new LocalDate(2012, 3, 2), new LocalDate(2012, 3, 31), InvoiceItemType.RECURRING, new BigDecimal("233.82")), new ExpectedInvoiceItemCheck(InvoiceItemType.ITEM_ADJ, new BigDecimal("-233.82")));
}
use of org.killbill.billing.beatrix.util.RefundChecker.ExpectedRefundCheck in project killbill by killbill.
the class TestPaymentRefund method testRefundWithNoAdjustments.
@Test(groups = "slow")
public void testRefundWithNoAdjustments() throws Exception {
// Although we don't adjust the invoice, the invoicing system sends an event because invoice balance changes and overdue system-- in particular-- needs to know about it.
refundPaymentAndCheckForCompletion(account, payment, NextEvent.PAYMENT, NextEvent.INVOICE_PAYMENT);
refundChecker.checkRefund(payment.getId(), callContext, new ExpectedRefundCheck(payment.getId(), false, new BigDecimal("233.82"), Currency.USD, initialCreationDate.toLocalDate()));
}
Aggregations