protected void assertionException(final CaseChangeResult cr, final String fromProductName, final String toProductName, final ProductCategory fromProductCategory, final ProductCategory toProductCategory, final BillingPeriod fromBp, final BillingPeriod toBp, final String fromPriceListName, final String toPriceListName, final PhaseType phaseType, final StandaloneCatalog cat) { try { cr.getResult(new PlanPhaseSpecifier(fromProductName, fromProductCategory, fromBp, fromPriceListName, phaseType), new PlanSpecifier(toProductName, toProductCategory, toBp, toPriceListName), cat); Assert.fail("Expecting an exception"); } catch (CatalogApiException e) { Assert.assertEquals(e.getCode(), ErrorCode.CAT_PRICE_LIST_NOT_FOUND.getCode()); } }
final DefaultPriceList priceList2 = cat.getPriceLists().getChildPriceLists()[1]; final CaseChangeResult cr = new CaseChangeResult( product1, product2, ProductCategory.BASE, ProductCategory.BASE,
final DefaultPriceList priceList2 = cat.getPriceLists().getChildPriceLists()[1]; final CaseChangeResult cr = new CaseChangeResult( product1, product2, ProductCategory.BASE, null,
final DefaultPriceList priceList2 = cat.getPriceLists().getChildPriceLists()[1]; final CaseChangeResult cr = new CaseChangeResult( product1, product2, null, ProductCategory.BASE,
final DefaultPriceList priceList2 = cat.getPriceLists().getChildPriceLists()[1]; final CaseChangeResult cr = new CaseChangeResult( product1, product2, ProductCategory.BASE, ProductCategory.BASE,
final DefaultPriceList priceList2 = cat.getPriceLists().getChildPriceLists()[1]; final CaseChangeResult cr = new CaseChangeResult( product1, product2, ProductCategory.BASE, ProductCategory.BASE,
final DefaultPriceList priceList2 = cat.getPriceLists().getChildPriceLists()[1]; final CaseChangeResult cr = new CaseChangeResult( product1, null, ProductCategory.BASE, ProductCategory.BASE,
final DefaultPriceList priceList2 = cat.getPriceLists().getChildPriceLists()[1]; final CaseChangeResult cr = new CaseChangeResult( null, product2, ProductCategory.BASE, ProductCategory.BASE,
final DefaultPriceList priceList2 = cat.getPriceLists().getChildPriceLists()[1]; final CaseChangeResult cr = new CaseChangeResult( product1, product2, ProductCategory.BASE, ProductCategory.BASE,
final DefaultPriceList priceList2 = cat.getPriceLists().getChildPriceLists()[1]; final CaseChangeResult cr = new CaseChangeResult( product1, product2, ProductCategory.BASE, ProductCategory.BASE,
final DefaultPriceList priceList2 = cat.getPriceLists().getChildPriceLists()[1]; final CaseChangeResult cr = new CaseChangeResult( product1, product2, ProductCategory.BASE, ProductCategory.BASE,
final DefaultPriceList priceList2 = cat.getPriceLists().getChildPriceLists()[1]; final CaseChangeResult cr0 = new CaseChangeResult( product1, product2, ProductCategory.BASE, ProductCategory.BASE, Result.FOO); final CaseChangeResult cr1 = new CaseChangeResult( product1, product2, ProductCategory.BASE, ProductCategory.BASE, Result.BAR); final CaseChangeResult cr2 = new CaseChangeResult( product1, product2, ProductCategory.BASE, ProductCategory.BASE, Result.TINKYWINKY); final CaseChangeResult cr3 = new CaseChangeResult( product1, product2, ProductCategory.BASE, ProductCategory.BASE, final CaseChangeResult cr4 = new CaseChangeResult( product1, product2, ProductCategory.BASE, ProductCategory.BASE,
public CaseChangeResult(final DefaultProduct from, final DefaultProduct to, final ProductCategory fromProductCategory, final ProductCategory toProductCategory, final BillingPeriod fromBP, final BillingPeriod toBP, final DefaultPriceList fromPriceList, final DefaultPriceList toPriceList, final PhaseType fromType, final Result result) { setFromProduct(from); setToProduct(to); setFromProductCategory(fromProductCategory); setToProductCategory(toProductCategory); setFromPriceList(fromPriceList); setToPriceList(toPriceList); setFromBillingPeriod(fromBP); setToBillingPeriod(toBP); setPhaseType(fromType); this.result = result; }
protected void assertion(final Result result, final CaseChangeResult cr, final String fromProductName, final String toProductName, final ProductCategory fromProductCategory, final ProductCategory toProductCategory, final BillingPeriod fromBp, final BillingPeriod toBp, final String fromPriceListName, final String toPriceListName, final PhaseType phaseType, final StandaloneCatalog cat) { try { Assert.assertEquals(result, cr.getResult(new PlanPhaseSpecifier(fromProductName, fromProductCategory, fromBp, fromPriceListName, phaseType), new PlanSpecifier(toProductName, toProductCategory, toBp, toPriceListName), cat)); } catch (CatalogApiException e) { Assert.fail("", e); } } }
protected void assertionNull(final CaseChangeResult cr, final String fromProductName, final String toProductName, final ProductCategory fromProductCategory, final ProductCategory toProductCategory, final BillingPeriod fromBp, final BillingPeriod toBp, final String fromPriceListName, final String toPriceListName, final PhaseType phaseType, final StandaloneCatalog cat) { try { Assert.assertNull(cr.getResult(new PlanPhaseSpecifier(fromProductName, fromProductCategory, fromBp, fromPriceListName, phaseType), new PlanSpecifier(toProductName, toProductCategory, toBp, toPriceListName), cat)); } catch (CatalogApiException e) { Assert.fail("", e); } }