Tabnine Logo
PlanPhase.getName
Code IndexAdd Tabnine to your IDE (free)

How to use
getName
method
in
com.ning.billing.catalog.api.PlanPhase

Best Java code snippets using com.ning.billing.catalog.api.PlanPhase.getName (Showing top 19 results out of 315)

origin: com.ning.billing/killbill-junction

@Override
public String toString() {
  // Note: we don't use all fields here, as the output would be overwhelming
  // (these events are printed in the logs in junction and invoice).
  final StringBuilder sb = new StringBuilder();
  sb.append("DefaultBillingEvent");
  sb.append("{type=").append(type);
  sb.append(", effectiveDate=").append(effectiveDate);
  sb.append(", planPhaseName=").append(planPhase.getName());
  sb.append(", subscriptionId=").append(subscription.getId());
  sb.append(", totalOrdering=").append(totalOrdering);
  sb.append(", accountId=").append(account.getId());
  sb.append('}');
  return sb.toString();
}
origin: com.ning.billing/killbill-catalog

@Override
public PlanPhase findPhase(final String name) throws CatalogApiException {
  for (final PlanPhase pp : getAllPhases()) {
    if (pp.getName().equals(name)) {
      return pp;
    }
  }
  throw new CatalogApiException(ErrorCode.CAT_NO_SUCH_PHASE, name);
}
origin: com.ning.billing/killbill-junction

  private DateTime createSubscriptionCreationEvent(final Plan nextPlan, final PlanPhase nextPhase) throws CatalogApiException {
    final DateTime now = clock.getUTCNow();
    final DateTime then = now.minusDays(1);
    final PriceList nextPriceList = catalog.findPriceList(PriceListSet.DEFAULT_PRICELIST_NAME, now);

    final EffectiveSubscriptionInternalEvent t = new MockEffectiveSubscriptionEvent(
        eventId, subId, bunId, then, now, null, null, null, null, EntitlementState.ACTIVE,
        nextPlan.getName(), nextPhase.getName(),
        nextPriceList.getName(), 1L,
        SubscriptionBaseTransitionType.CREATE, 1, null, 1L, 2L, null);

    effectiveSubscriptionTransitions.add(t);
    return now;
  }
}
origin: com.ning.billing/killbill-analytics

    BusinessSubscriptionEvent.subscriptionCreated(plan.getName(), catalog, clock.getUTCNow(), clock.getUTCNow()),
    null,
    new BusinessSubscription("DEFAULT", plan.getName(), phase.getName(), Currency.USD, clock.getUTCNow(), SubscriptionState.ACTIVE, catalog)
);
subscriptionTransitionSqlDao.createTransition(transition, internalCallContext);
Assert.assertEquals(notFoundData.getValues().size(), 0);
final TimeSeriesData data = analyticsUserApi.getSubscriptionsCreatedOverTime(productType, phase.getName(), callContext);
Assert.assertEquals(data.getDates().size(), 1);
Assert.assertEquals(data.getDates().get(0), clock.getUTCToday());
origin: com.ning.billing/killbill-invoice

thisEvent.getSubscription().getId(),
thisEvent.getPlan().getName(),
thisEvent.getPlanPhase().getName(),
itemDatum.getStartDate(), itemDatum.getEndDate(),
amount, rate, currency);
origin: com.ning.billing/killbill-analytics

/**
 * For unit tests only.
 * <p/>
 * You can't really use this constructor in real life because the start date is likely not the one you want (you likely
 * want the phase start date).
 *
 * @param subscription Subscription to use as a model
 * @param currency     ACCOUNT currency
 * @param catalog      Catalog to use
 */
BusinessSubscription(final Subscription subscription, final Currency currency, final Catalog catalog) {
  this(subscription.getCurrentPriceList() == null ? null : subscription.getCurrentPriceList().getName(),
     subscription.getCurrentPlan().getName(), subscription.getCurrentPhase().getName(), currency,
     subscription.getStartDate(), subscription.getState(), catalog);
}
origin: com.ning.billing/killbill-analytics

@Test(groups = "fast")
public void testConstructor() throws Exception {
  Assert.assertEquals(subscription.getRoundedMrr(), 0.0);
  Assert.assertEquals(subscription.getSlug(), phase.getName());
  Assert.assertEquals(subscription.getPhase(), phase.getPhaseType().toString());
  Assert.assertEquals(subscription.getBillingPeriod(), phase.getBillingPeriod());
  Assert.assertEquals(subscription.getPrice(), phase.getRecurringPrice().getPrice(null));
  Assert.assertEquals(subscription.getProductCategory(), product.getCategory());
  Assert.assertEquals(subscription.getProductName(), product.getName());
  Assert.assertEquals(subscription.getProductType(), product.getCatalogName());
  Assert.assertEquals(subscription.getStartDate(), isubscription.getStartDate());
}
origin: com.ning.billing/killbill-analytics

private void setupBusinessSubscriptionTransition() {
  final DateTime requestedTimestamp = clock.getUTCNow();
  final BusinessSubscription prevSubscription = new BusinessSubscription(null, plan.getName(), phase.getName(), Currency.USD, clock.getUTCNow(), SubscriptionState.ACTIVE, catalog);
  final BusinessSubscription nextSubscription = new BusinessSubscription(null, plan.getName(), phase.getName(), Currency.USD, clock.getUTCNow(), SubscriptionState.CANCELLED, catalog);
  final BusinessSubscriptionEvent event = BusinessSubscriptionEvent.subscriptionCancelled(plan.getName(), catalog, requestedTimestamp, requestedTimestamp);
  transition = new BusinessSubscriptionTransitionModelDao(TOTAL_ORDERING, BUNDLE_ID, EXTERNAL_KEY, ACCOUNT_ID, ACCOUNT_KEY,
                              UUID.randomUUID(), requestedTimestamp, event, prevSubscription, nextSubscription);
}
origin: com.ning.billing/killbill-invoice

Mockito.when(phase1.getName()).thenReturn("plan-phase1");
Mockito.when(phase2.getName()).thenReturn("plan-phase2");
origin: com.ning.billing/killbill-invoice

  InvoiceItem generateFixedPriceItem(final UUID invoiceId, final UUID accountId, final BillingEvent thisEvent,
                    final LocalDate targetDate, final Currency currency) {
    final LocalDate roundedStartDate = new LocalDate(thisEvent.getEffectiveDate(), thisEvent.getTimeZone());

    if (roundedStartDate.isAfter(targetDate)) {
      return null;
    } else {
      final BigDecimal fixedPrice = thisEvent.getFixedPrice();

      if (fixedPrice != null) {
        return new FixedPriceInvoiceItem(invoiceId, accountId, thisEvent.getSubscription().getBundleId(),
                         thisEvent.getSubscription().getId(),
                         thisEvent.getPlan().getName(), thisEvent.getPlanPhase().getName(),
                         roundedStartDate, fixedPrice, currency);
      } else {
        return null;
      }
    }
  }
}
origin: com.ning.billing/killbill-invoice

Mockito.when(phase1.getName()).thenReturn("plan-phase1");
Mockito.when(phase2.getName()).thenReturn("plan-phase2");
origin: com.ning.billing/killbill-analytics

public BusinessInvoiceItemModelDao(@Nullable final String externalKey, final InvoiceItem invoiceItem, @Nullable final Plan plan, @Nullable final PlanPhase planPhase) {
  this(invoiceItem.getAmount(), planPhase != null ? planPhase.getBillingPeriod().toString() : null, invoiceItem.getCreatedDate(), invoiceItem.getCurrency(),
     /* Populate end date for fixed items for convenience (null in invoice_items table) */
     (invoiceItem.getEndDate() == null && planPhase != null) ? invoiceItem.getStartDate().plus(planPhase.getDuration().toJodaPeriod()) : invoiceItem.getEndDate(),
     externalKey, invoiceItem.getInvoiceId(), invoiceItem.getId(), invoiceItem.getLinkedItemId(), invoiceItem.getInvoiceItemType().toString(),
     planPhase != null ? planPhase.getPhaseType().toString() : null, plan != null ? plan.getProduct().getCategory().toString() : null,
     plan != null ? plan.getProduct().getName() : null, plan != null ? plan.getProduct().getCatalogName() : null,
     planPhase != null ? planPhase.getName() : null, invoiceItem.getStartDate(), invoiceItem.getUpdatedDate());
}
origin: com.ning.billing/killbill-analytics

@Test(groups = "slow")
public void testTransitionsWithNullPlan() throws Exception {
  final BusinessSubscription subscriptionWithNullPlan = new BusinessSubscription(null, null, phase.getName(), Currency.USD, null, null, catalog);
  final BusinessSubscriptionTransitionModelDao transitionWithNullPlan = new BusinessSubscriptionTransitionModelDao(
      transition.getTotalOrdering(),
      transition.getBundleId(),
      transition.getExternalKey(),
      transition.getAccountId(),
      transition.getAccountKey(),
      transition.getSubscriptionId(),
      transition.getRequestedTimestamp(),
      transition.getEvent(),
      subscriptionWithNullPlan,
      subscriptionWithNullPlan
  );
  subscriptionTransitionSqlDao.createTransition(transitionWithNullPlan, internalCallContext);
  final List<BusinessSubscriptionTransitionModelDao> transitions = subscriptionTransitionSqlDao.getTransitionsByKey(EXTERNAL_KEY, internalCallContext);
  Assert.assertEquals(transitions.size(), 1);
  // Null Plan but Phase - we don't turn the subscription into a null
  Assert.assertEquals(transitions.get(0), transitionWithNullPlan);
}
origin: com.ning.billing/killbill-subscription

assertTrue(initialMigrateBilling.getEffectiveTransitionTime().compareTo(subscription.getChargedThroughDate()) == 0);
assertEquals(initialMigrateBilling.getNextPlan().getName(), "shotgun-annual");
assertEquals(initialMigrateBilling.getNextPhase().getName(), "shotgun-annual-evergreen");
assertTrue(newMigrateBilling.getEffectiveTransitionTime().compareTo(initialMigrateBilling.getEffectiveTransitionTime()) == 0);
assertEquals(newMigrateBilling.getNextPlan().getName(), "assault-rifle-monthly");
assertEquals(newMigrateBilling.getNextPhase().getName(), "assault-rifle-monthly-evergreen");
origin: com.ning.billing/killbill-analytics

slug = thePhase.getName();
origin: com.ning.billing/killbill-analytics

@Test(groups = "slow")
public void testTransitionsWithNullFieldsInSubscription() {
  final BusinessSubscription subscriptionWithNullFields = new BusinessSubscription(null, plan.getName(), phase.getName(), Currency.USD, null, null, catalog);
  final BusinessSubscriptionTransitionModelDao transitionWithNullFields = new BusinessSubscriptionTransitionModelDao(
      transition.getTotalOrdering(),
      transition.getBundleId(),
      transition.getExternalKey(),
      transition.getAccountId(),
      transition.getAccountKey(),
      transition.getSubscriptionId(),
      transition.getRequestedTimestamp(),
      transition.getEvent(),
      subscriptionWithNullFields,
      subscriptionWithNullFields
  );
  subscriptionTransitionSqlDao.createTransition(transitionWithNullFields, internalCallContext);
  final List<BusinessSubscriptionTransitionModelDao> transitions = subscriptionTransitionSqlDao.getTransitionsByKey(EXTERNAL_KEY, internalCallContext);
  Assert.assertEquals(transitions.size(), 1);
  Assert.assertEquals(transitions.get(0), transitionWithNullFields);
}
origin: com.ning.billing/killbill-subscription

assertEquals(subscription.getState(), EntitlementState.ACTIVE);
assertEquals(subscription.getCurrentPlan().getName(), "assault-rifle-monthly");
assertEquals(subscription.getCurrentPhase().getName(), "assault-rifle-monthly-evergreen");
origin: com.ning.billing/killbill-jaxrs

priceList != null ? priceList.getName() : null,
cur.getSubscriptionEventType().toString(),
phase != null ? phase.getName() : null,
toAuditLogJson(accountAuditLogs == null ? null : accountAuditLogs.getAuditLogsForSubscriptionEvent(cur.getId()))));
origin: com.ning.billing/killbill-analytics

slug = currentPhase.getName();
com.ning.billing.catalog.apiPlanPhasegetName

Popular methods of PlanPhase

  • getRecurringPrice
  • getPhaseType
  • getBillingPeriod
  • getDuration
  • getFixedPrice
  • compliesWithLimits

Popular in Java

  • Creating JSON documents from java classes using gson
  • getResourceAsStream (ClassLoader)
  • getSharedPreferences (Context)
  • getContentResolver (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now