Assert.assertEquals(invoice.getCurrency(), "USD"); Assert.assertEquals(invoice.getCreatedAt(), new DateTime("2011-08-25T12:00:00Z")); Assert.assertNotNull(invoice.getLineItems()); Assert.assertEquals(invoice.getLineItems().size(), 1); Assert.assertEquals(invoice.getTransactions().size(), 0); Assert.assertEquals(invoice.getAttemptNextCollectionAt(), new DateTime("2017-08-31T00:00:00Z"));
Assert.assertEquals(invoice.getCurrency(), "USD"); Assert.assertEquals(invoice.getCreatedAt(), new DateTime("2011-08-25T12:00:00Z")); Assert.assertNotNull(invoice.getLineItems()); Assert.assertEquals(invoice.getLineItems().size(), 1); Assert.assertEquals(invoice.getTransactions().size(), 0); Assert.assertEquals(invoice.getAttemptNextCollectionAt(), new DateTime("2017-08-31T00:00:00Z"));
Assert.assertEquals(invoice.getUpdatedAt(), new DateTime("2011-08-25T12:00:00Z")); Assert.assertEquals(invoice.getClosedAt(), new DateTime("2011-08-25T12:00:00Z")); Assert.assertNotNull(invoice.getLineItems()); Assert.assertEquals(invoice.getLineItems().size(), 1); Assert.assertEquals(invoice.getInvoiceNumberPrefix(), "FR"); Assert.assertEquals(invoice.getId(), "FR1402"); final Adjustment adjustment = invoice.getLineItems().get(0); Assert.assertEquals(adjustment.getDescription(), "Charge for extra bandwidth"); Assert.assertEquals((int) adjustment.getTotalInCents(), 5000);
Assert.assertEquals(invoice.getUpdatedAt(), new DateTime("2011-08-25T12:00:00Z")); Assert.assertEquals(invoice.getClosedAt(), new DateTime("2011-08-25T12:00:00Z")); Assert.assertNotNull(invoice.getLineItems()); Assert.assertEquals(invoice.getLineItems().size(), 1); Assert.assertEquals(invoice.getInvoiceNumberPrefix(), "FR"); Assert.assertEquals(invoice.getId(), "FR1402"); final Adjustment adjustment = invoice.getLineItems().get(0); Assert.assertEquals(adjustment.getDescription(), "Charge for extra bandwidth"); Assert.assertEquals((int) adjustment.getTotalInCents(), 5000);
final AdjustmentRefund adjustmentRefund = invoice.getLineItems().get(0).toAdjustmentRefund(); Assert.assertEquals(refundInvoice.getTransactions().get(0).getAction(), "refund"); Assert.assertEquals(refundInvoice.getLineItems().size(), 1); final Adjustment lineItem = refundInvoice.getLineItems().get(0); Assert.assertEquals(lineItem.getQuantity(), new Integer(1)); } finally {
final AdjustmentRefund adjustmentRefund = invoice.getLineItems().get(0).toAdjustmentRefund(); Assert.assertEquals(refundInvoice.getTransactions().get(0).getAction(), "refund"); Assert.assertEquals(refundInvoice.getLineItems().size(), 1); final Adjustment lineItem = refundInvoice.getLineItems().get(0); Assert.assertEquals(lineItem.getQuantity(), new Integer(1)); } finally {
String subscriptionId = invoice.getLineItems().get(0).getSubscriptionId(); Subscription sub = recurlyClient.getSubscription(subscriptionId); Assert.assertEquals(sub.getUuid(), subscriptionId);
String subscriptionId = invoice.getLineItems().get(0).getSubscriptionId(); Subscription sub = recurlyClient.getSubscription(subscriptionId); Assert.assertEquals(sub.getUuid(), subscriptionId);