private SubscriptionBaseTransition createTransition( final UUID entitlementId, final EventType eventType, final ApiEventType apiEventType, final DateTime requestedDate, final DateTime effectiveDate, final DateTime createdDate, final String prevPhaseName, final String nextPhaseName) throws CatalogApiException { final PlanPhase prevPhase = prevPhaseName != null ? Mockito.mock(PlanPhase.class) : null; if (prevPhase != null) { Mockito.when(prevPhase.getName()).thenReturn(prevPhaseName); } final PlanPhase nextPhase = nextPhaseName != null ? Mockito.mock(PlanPhase.class) : null; if (nextPhase != null) { Mockito.when(nextPhase.getName()).thenReturn(nextPhaseName); } // catalogService.getCurrentCatalog().findCurrentPhase("pistol-monthly-trial"); final Plan plan = Mockito.mock(Plan.class); Mockito.when(plan.getName()).thenReturn("plan"); // catalogService.getCurrentCatalog().findCurrentPlan("pistol-monthly"); final Product product = Mockito.mock(Product.class); Mockito.when(product.getName()).thenReturn("product"); // catalogService.getCurrentCatalog().findCurrentProduct("Pistol"); final PriceList priceList = Mockito.mock(PriceList.class); Mockito.when(priceList.getName()).thenReturn("pricelist"); // catalogService.getCurrentCatalog().findCurrentPricelist(PriceListSet.DEFAULT_PRICELIST_NAME); final BillingPeriod billingPeriod = BillingPeriod.MONTHLY; final SubscriptionBaseTransition transition = new SubscriptionBaseTransitionData( UUID.randomUUID(), entitlementId, bundleId, eventType, apiEventType, requestedDate, effectiveDate, null, null, null, plan, prevPhase, priceList, null, null, null, plan, nextPhase, priceList, 1L, createdDate, UUID.randomUUID(), true); return transition; }