@Test(groups = "slow")
  public void testAddAndRemoveTagsForBundle() throws Exception {
    final String name = UUID.randomUUID().toString().substring(0, 20);
    final CallContext callContext =
        callContextFactory.createCallContext(
            UUID.randomUUID().toString(), CallOrigin.TEST, UserType.TEST);
    final String externalKey = UUID.randomUUID().toString();

    final Account accountData = new MockAccountBuilder().currency(Currency.MXN).build();
    final Account account = accountUserApi.createAccount(accountData, callContext);
    final SubscriptionBundle bundle =
        entitlementUserApi.createBundleForAccount(account.getId(), externalKey, callContext);
    final UUID bundleId = bundle.getId();

    Assert.assertEquals(
        subscriptionTransitionTagSqlDao
            .getTagsForBusinessSubscriptionTransitionByKey(externalKey)
            .size(),
        0);
    tagRecorder.tagAdded(ObjectType.BUNDLE, bundleId, name);
    Assert.assertEquals(
        subscriptionTransitionTagSqlDao
            .getTagsForBusinessSubscriptionTransitionByKey(externalKey)
            .size(),
        1);
    tagRecorder.tagRemoved(ObjectType.BUNDLE, bundleId, name);
    Assert.assertEquals(
        subscriptionTransitionTagSqlDao
            .getTagsForBusinessSubscriptionTransitionByKey(externalKey)
            .size(),
        0);
  }
示例#2
0
 public void processOverdueForBundle(final UUID bundleId) {
   try {
     final SubscriptionBundle bundle = entitlementUserApi.getBundleFromId(bundleId);
     processOverdue(bundle);
   } catch (EntitlementUserApiException e) {
     log.error("Error processing Overdue for Bundle with id: " + bundleId.toString(), e);
   }
 }
示例#3
0
 public void processOverdueForAccount(final UUID accountId) {
   final List<SubscriptionBundle> bundles = entitlementUserApi.getBundlesForAccount(accountId);
   for (final SubscriptionBundle bundle : bundles) {
     processOverdue(bundle);
   }
 }