Search in sources :

Example 1 with DeletedSubscriptionItem

use of com.stripe.model.DeletedSubscriptionItem in project stripe-java by stripe.

the class SubscriptionItemTest method testSubscriptionItemDelete.

@Test
public void testSubscriptionItemDelete() throws StripeException {
    Customer customer = Customer.create(defaultCustomerParams);
    Subscription subscription = createDefaultSubscription(customer);
    SubscriptionItem subscriptionItem = createDefaultSubscriptionItem(subscription);
    DeletedSubscriptionItem deletedSubscriptionItem = subscriptionItem.delete();
    assertTrue(deletedSubscriptionItem.getDeleted());
    assertEquals(deletedSubscriptionItem.getId(), subscriptionItem.getId());
}
Also used : DeletedSubscriptionItem(com.stripe.model.DeletedSubscriptionItem) SubscriptionItem(com.stripe.model.SubscriptionItem) Customer(com.stripe.model.Customer) DeletedSubscriptionItem(com.stripe.model.DeletedSubscriptionItem) Subscription(com.stripe.model.Subscription) BaseStripeFunctionalTest(com.stripe.BaseStripeFunctionalTest) Test(org.junit.Test)

Aggregations

BaseStripeFunctionalTest (com.stripe.BaseStripeFunctionalTest)1 Customer (com.stripe.model.Customer)1 DeletedSubscriptionItem (com.stripe.model.DeletedSubscriptionItem)1 Subscription (com.stripe.model.Subscription)1 SubscriptionItem (com.stripe.model.SubscriptionItem)1 Test (org.junit.Test)1