use of com.stripe.model.SubscriptionItemCollection in project stripe-java by stripe.
the class SubscriptionItemTest method testSubscriptionItemList.
@Test
public void testSubscriptionItemList() throws StripeException {
Customer customer = Customer.create(defaultCustomerParams);
Subscription subscription = createDefaultSubscription(customer);
createDefaultSubscriptionItem(subscription);
Map<String, Object> listParams = new HashMap<String, Object>();
listParams.put("subscription", subscription.getId());
SubscriptionItemCollection subscriptionItems = SubscriptionItem.list(listParams);
List<SubscriptionItem> subscriptionItemsData = subscriptionItems.getData();
assertEquals(subscriptionItemsData.size(), 2);
}
Aggregations