use of org.killbill.billing.client.model.EventSubscription in project killbill by killbill.
the class TestAccountTimeline method testAccountTimeline.
@Test(groups = "slow", description = "Can retrieve the timeline without audits")
public void testAccountTimeline() throws Exception {
clock.setTime(new DateTime(2012, 4, 25, 0, 3, 42, 0));
final Account accountJson = createAccountWithPMBundleAndSubscriptionAndWaitForFirstInvoice();
final AccountTimeline timeline = getAccountTimeline(accountJson.getAccountId(), AuditLevel.NONE);
Assert.assertEquals(timeline.getPayments().size(), 1);
Assert.assertEquals(timeline.getInvoices().size(), 2);
Assert.assertEquals(timeline.getBundles().size(), 1);
Assert.assertEquals(timeline.getBundles().get(0).getSubscriptions().size(), 1);
Assert.assertEquals(timeline.getBundles().get(0).getSubscriptions().get(0).getEvents().size(), 3);
final List<EventSubscription> events = timeline.getBundles().get(0).getSubscriptions().get(0).getEvents();
Assert.assertEquals(events.get(0).getEffectiveDate(), new LocalDate(2012, 4, 25));
Assert.assertEquals(events.get(0).getEventType(), "START_ENTITLEMENT");
Assert.assertEquals(events.get(1).getEffectiveDate(), new LocalDate(2012, 4, 25));
Assert.assertEquals(events.get(1).getEventType(), "START_BILLING");
Assert.assertEquals(events.get(2).getEffectiveDate(), new LocalDate(2012, 5, 25));
Assert.assertEquals(events.get(2).getEventType(), "PHASE");
}
Aggregations