@Test public void testUpdateSubscriptionPerCallAPIKey() throws StripeException { Plan plan = Plan.create(getUniquePlanParams(), Stripe.apiKey); Customer customer = Customer.create(defaultCustomerParams, Stripe.apiKey); Map<String, Object> subscriptionParams = new HashMap<String, Object>(); subscriptionParams.put("plan", plan.getId()); Subscription sub = customer.updateSubscription(subscriptionParams, Stripe.apiKey); assertEquals(sub.getPlan().getId(), plan.getId()); assertEquals(sub.getCustomer(), customer.getId()); }