Conversation
|
If you agree that this is a bug, I can write a test for this fix. |
|
For 2/- above, I've added a test See c29ce39. |
| requestOptions); | ||
| callbackServlet.assertListenerStatus(); | ||
| final Subscription subscription = subscriptionApi.getSubscription(entitlementJson.getSubscriptionId(), requestOptions); | ||
| Assert.assertEquals(subscription.getState(), EntitlementState.ACTIVE); |
There was a problem hiding this comment.
Any way we could check that price was correctly overridden - would subscription#getLastActivePlan() provide such info?
| for (final PhasePriceJson input : priceOverrides) { | ||
| Preconditions.checkNotNull(input); | ||
|
|
||
| Preconditions.checkArgument(input.getFixedPrice() != null || input.getRecurringPrice() != null || input.getUsagePrices() != null || (input.getUsagePrices() != null && !input.getUsagePrices().isEmpty()), |
There was a problem hiding this comment.
I think we can remove the input.getUsagePrices() != null and simply keep the (input.getUsagePrices() != null && !input.getUsagePrices().isEmpty()
| final PlanPhaseSpecifier planPhaseSpecifier = spec.getPlanName() != null ? | ||
| new PlanPhaseSpecifier(spec.getPlanName(), phaseType) : | ||
| new PlanPhaseSpecifier(spec.getProductName(), spec.getBillingPeriod(), spec.getPriceListName(), phaseType); | ||
| final Currency resolvedCurrency = input.getFixedPrice() != null || input.getRecurringPrice() != null || (input.getUsagePrices() != null && !input.getUsagePrices().isEmpty()) ? currency : null; |
There was a problem hiding this comment.
Good point, I don't think this is needed.
There is a bug in the code due to which it is currently not possible to override a usage price by itself, it is necessary to update either a fixed or a recurring price too. This PR attempts to address this bug.
See this comment.