catalog: Ensure we always do the validation on the user input SimplePlanDescriptor when modifying catalog version. See
@@ -115,6 +115,8 @@ public class CatalogUpdater {
throw new CatalogApiException(ErrorCode.CAT_INVALID_SIMPLE_PLAN_DESCRIPTOR, desc);
}
+ validateNewPlanDescriptor(desc);
+
DefaultProduct product = plan != null ? (DefaultProduct) plan.getProduct() : (DefaultProduct) getExistingProduct(desc.getProductName());
if (product == null) {
product = new DefaultProduct();
@@ -126,8 +128,6 @@ public class CatalogUpdater {
if (plan == null) {
- validateNewPlanDescriptor(desc);
-
plan = new DefaultPlan();
plan.setName(desc.getPlanId());
plan.setPriceListName(PriceListSet.DEFAULT_PRICELIST_NAME);
