protected void assertionException(
     final CaseResult cr,
     final String productName,
     final ProductCategory productCategory,
     final BillingPeriod bp,
     final String priceListName,
     final PhaseType phaseType,
     final StandaloneCatalog cat) {
   try {
     Assert.assertNull(
         cr.getResult(
             new PlanPhaseSpecifier(productName, productCategory, bp, priceListName, phaseType),
             cat));
     Assert.fail("Exception expected");
   } catch (CatalogApiException e) {
     Assert.assertEquals(e.getCode(), ErrorCode.CAT_PRICE_LIST_NOT_FOUND.getCode());
   }
 }
  @Test(groups = "slow")
  public void testAddonCreateWithSubscriptionAlign() {
    try {
      final String aoProduct = "Laser-Scope";
      final BillingPeriod aoTerm = BillingPeriod.MONTHLY;
      final String aoPriceList = PriceListSet.DEFAULT_PRICELIST_NAME;

      // This is just to double check our test catalog gives us what we want before we start the
      // test
      final PlanSpecifier planSpecifier =
          new PlanSpecifier(aoProduct, ProductCategory.ADD_ON, aoTerm, aoPriceList);
      final PlanAlignmentCreate alignement =
          catalog.planCreateAlignment(planSpecifier, clock.getUTCNow());
      assertEquals(alignement, PlanAlignmentCreate.START_OF_SUBSCRIPTION);

      testAddonCreateInternal(aoProduct, aoTerm, aoPriceList, alignement);

      assertListenerStatus();
    } catch (CatalogApiException e) {
      Assert.fail(e.getMessage());
    }
  }