subscription.changePlan("Pistol", BillingPeriod.MONTHLY, "gunclubDiscount", callContext); assertFalse(testListener.isCompleted(3000)); testListener.reset(); subscription.changePlan("Assault-Rifle", BillingPeriod.ANNUAL, "gunclubDiscount", callContext); assertListenerStatus();
testListener.pushExpectedEvent(NextEvent.CHANGE); testListener.pushExpectedEvent(NextEvent.CANCEL); baseSubscription.changePlan(newBaseProduct, newBaseTerm, newBasePriceList, callContext); assertListenerStatus();
private void tChangePlanBundleAlignEOTWithNoChargeThroughDate(final String fromProd, final BillingPeriod fromTerm, final String fromPlanSet, final String toProd, final BillingPeriod toTerm, final String toPlanSet) { try { // CREATE final DefaultSubscriptionBase subscription = testUtil.createSubscription(bundle, fromProd, fromTerm, fromPlanSet); // MOVE TO NEXT PHASE PlanPhase currentPhase = subscription.getCurrentPhase(); testListener.pushExpectedEvent(NextEvent.PHASE); final Interval it = new Interval(clock.getUTCNow(), clock.getUTCNow().plusDays(31)); clock.addDeltaFromReality(it.toDurationMillis()); final DateTime futureNow = clock.getUTCNow(); final DateTime nextExpectedPhaseChange = TestSubscriptionHelper.addDuration(subscription.getStartDate(), currentPhase.getDuration()); assertTrue(futureNow.isAfter(nextExpectedPhaseChange)); assertListenerStatus(); // CHANGE PLAN testListener.pushExpectedEvent(NextEvent.CHANGE); subscription.changePlan(toProd, toTerm, toPlanSet, callContext); assertListenerStatus(); // CHECK CHANGE PLAN currentPhase = subscription.getCurrentPhase(); checkChangePlan(subscription, toProd, ProductCategory.BASE, toTerm, PhaseType.EVERGREEN); assertListenerStatus(); } catch (SubscriptionBaseApiException e) { Assert.fail(e.getMessage()); } }
subscription.changePlan("Assault-Rifle", BillingPeriod.ANNUAL, "gunclubDiscount", callContext); assertListenerStatus(); testListener.reset();
private void tChangePlanBundleAlignIMM(final String fromProd, final BillingPeriod fromTerm, final String fromPlanSet, final String toProd, final BillingPeriod toTerm, final String toPlanSet) throws SubscriptionBaseApiException { final DefaultSubscriptionBase subscription = testUtil.createSubscription(bundle, fromProd, fromTerm, fromPlanSet); testListener.pushExpectedEvent(NextEvent.CHANGE); Interval it = new Interval(clock.getUTCNow(), clock.getUTCNow().plusDays(3)); clock.addDeltaFromReality(it.toDurationMillis()); // CHANGE PLAN IMM subscription.changePlan(toProd, toTerm, toPlanSet, callContext); checkChangePlan(subscription, toProd, ProductCategory.BASE, toTerm, PhaseType.TRIAL); assertListenerStatus(); final PlanPhase currentPhase = subscription.getCurrentPhase(); final DateTime nextExpectedPhaseChange = TestSubscriptionHelper.addDuration(subscription.getStartDate(), currentPhase.getDuration()); testUtil.checkNextPhaseChange(subscription, 1, nextExpectedPhaseChange); // NEXT PHASE testListener.pushExpectedEvent(NextEvent.PHASE); it = new Interval(clock.getUTCNow(), clock.getUTCNow().plusDays(30)); clock.addDeltaFromReality(it.toDurationMillis()); final DateTime futureNow = clock.getUTCNow(); assertTrue(futureNow.isAfter(nextExpectedPhaseChange)); assertListenerStatus(); }
assertEquals(aoStatus.get(0).getReason(), DryRunChangeReason.AO_NOT_AVAILABLE_IN_NEW_PLAN); baseSubscription.changePlan(newBaseProduct, newBaseTerm, newBasePriceList, callContext);
subscription.changePlan("Shotgun", BillingPeriod.MONTHLY, "gunclubDiscount", callContext); assertFalse(testListener.isCompleted(3000)); testListener.reset(); subscription.changePlan("Pistol", BillingPeriod.ANNUAL, "gunclubDiscount", callContext); assertFalse(testListener.isCompleted(3000)); testListener.reset();
testListener.pushExpectedEvent(NextEvent.CHANGE); subscription = (DefaultSubscriptionBase) subscriptionInternalApi.getSubscriptionFromId(subscription.getId(), internalCallContext); subscription.changePlan(toProd, toTerm, toPlanSet, callContext); assertFalse(testListener.isCompleted(3000)); testListener.reset();
subscription.changePlan(toProd, toTerm, toPlanSet, callContext);