killbill-memoizeit

Changes

beatrix/pom.xml 8(+4 -4)

pom.xml 2(+1 -1)

server/pom.xml 8(+4 -4)

Details

beatrix/pom.xml 8(+4 -4)

diff --git a/beatrix/pom.xml b/beatrix/pom.xml
index d980175..9cd1141 100644
--- a/beatrix/pom.xml
+++ b/beatrix/pom.xml
@@ -70,10 +70,6 @@
         </dependency>
         <dependency>
             <groupId>com.ning.billing</groupId>
-            <artifactId>killbill-entitlement</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.ning.billing</groupId>
             <artifactId>killbill-internal-api</artifactId>
         </dependency>
         <dependency>
@@ -133,6 +129,10 @@
         </dependency>
         <dependency>
             <groupId>com.ning.billing</groupId>
+            <artifactId>killbill-subscription</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.ning.billing</groupId>
             <artifactId>killbill-tenant</artifactId>
         </dependency>
         <dependency>
diff --git a/beatrix/src/test/java/com/ning/billing/beatrix/integration/BeatrixIntegrationModule.java b/beatrix/src/test/java/com/ning/billing/beatrix/integration/BeatrixIntegrationModule.java
index 03a9a31..ed0359f 100644
--- a/beatrix/src/test/java/com/ning/billing/beatrix/integration/BeatrixIntegrationModule.java
+++ b/beatrix/src/test/java/com/ning/billing/beatrix/integration/BeatrixIntegrationModule.java
@@ -32,14 +32,13 @@ import com.ning.billing.beatrix.lifecycle.DefaultLifecycle;
 import com.ning.billing.beatrix.lifecycle.Lifecycle;
 import com.ning.billing.beatrix.util.AccountChecker;
 import com.ning.billing.beatrix.util.AuditChecker;
-import com.ning.billing.beatrix.util.EntitlementChecker;
+import com.ning.billing.beatrix.util.SubscriptionChecker;
 import com.ning.billing.beatrix.util.InvoiceChecker;
 import com.ning.billing.beatrix.util.PaymentChecker;
 import com.ning.billing.beatrix.util.RefundChecker;
 import com.ning.billing.catalog.api.CatalogService;
 import com.ning.billing.catalog.glue.CatalogModule;
 import com.ning.billing.subscription.api.SubscriptionService;
-import com.ning.billing.subscription.glue.DefaultSubscriptionModule;
 import com.ning.billing.invoice.api.InvoiceService;
 import com.ning.billing.invoice.generator.DefaultInvoiceGeneratorWithSwitchRepairLogic;
 import com.ning.billing.invoice.generator.InvoiceGenerator;
@@ -52,6 +51,7 @@ import com.ning.billing.overdue.OverdueService;
 import com.ning.billing.payment.api.PaymentService;
 import com.ning.billing.payment.glue.PaymentModule;
 import com.ning.billing.payment.provider.MockPaymentProviderPluginModule;
+import com.ning.billing.subscription.glue.DefaultSubscriptionModule;
 import com.ning.billing.tenant.glue.TenantModule;
 import com.ning.billing.usage.glue.UsageModule;
 import com.ning.billing.util.config.PaymentConfig;
@@ -124,7 +124,7 @@ public class BeatrixIntegrationModule extends AbstractModule {
         install(new BeatrixModuleWithSubsetLifecycle());
 
         bind(AccountChecker.class).asEagerSingleton();
-        bind(EntitlementChecker.class).asEagerSingleton();
+        bind(SubscriptionChecker.class).asEagerSingleton();
         bind(InvoiceChecker.class).asEagerSingleton();
         bind(PaymentChecker.class).asEagerSingleton();
         bind(RefundChecker.class).asEagerSingleton();
diff --git a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestIntegration.java b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestIntegration.java
index 8f52db4..87672ba 100644
--- a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestIntegration.java
+++ b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestIntegration.java
@@ -61,23 +61,23 @@ public class TestIntegration extends TestIntegrationBase {
         clock.setDay(new LocalDate(2012, 4, 1));
 
         final SubscriptionBundle bundle = entitlementUserApi.createBundleForAccount(account.getId(), "whatever", callContext);
-        entitlementChecker.checkBundleNoAudits(bundle.getId(), bundle.getAccountId(), bundle.getExternalKey(), callContext);
+        subscriptionChecker.checkBundleNoAudits(bundle.getId(), bundle.getAccountId(), bundle.getExternalKey(), callContext);
 
         //
         // CREATE SUBSCRIPTION AND EXPECT BOTH EVENTS: NextEvent.CREATE NextEvent.INVOICE
         //
         final Subscription bpSubscription = createSubscriptionAndCheckForCompletion(bundle.getId(), "Shotgun", ProductCategory.BASE, BillingPeriod.MONTHLY, NextEvent.CREATE, NextEvent.INVOICE);
         // Check bundle after BP got created otherwise we get an error from auditApi.
-        entitlementChecker.checkSubscriptionCreated(bpSubscription.getId(), callContext);
+        subscriptionChecker.checkSubscriptionCreated(bpSubscription.getId(), callContext);
         invoiceChecker.checkInvoice(account.getId(), 1, callContext, new ExpectedInvoiceItemCheck(new LocalDate(2012, 4, 1), null, InvoiceItemType.FIXED, new BigDecimal("0")));
-        entitlementChecker.checkBundleAuditUpdated(bundle.getId(), callContext);
+        subscriptionChecker.checkBundleAuditUpdated(bundle.getId(), callContext);
         //
         // ADD ADD_ON ON THE SAME DAY
         //
         createSubscriptionAndCheckForCompletion(bundle.getId(), "Telescopic-Scope", ProductCategory.ADD_ON, BillingPeriod.MONTHLY, NextEvent.CREATE, NextEvent.INVOICE, NextEvent.PAYMENT);
         Invoice invoice = invoiceChecker.checkInvoice(account.getId(), 2, callContext, new ExpectedInvoiceItemCheck(new LocalDate(2012, 4, 1), new LocalDate(2012, 5, 1), InvoiceItemType.RECURRING, new BigDecimal("399.95")));
         paymentChecker.checkPayment(account.getId(), 1, callContext, new ExpectedPaymentCheck(new LocalDate(2012, 4, 1), new BigDecimal("399.95"), PaymentStatus.SUCCESS, invoice.getId(), Currency.USD));
-        entitlementChecker.checkBundleAuditUpdated(bundle.getId(), callContext);
+        subscriptionChecker.checkBundleAuditUpdated(bundle.getId(), callContext);
 
         //
         // CANCEL BP ON THE SAME DAY (we should have two cancellations, BP and AO)
@@ -89,7 +89,7 @@ public class TestIntegration extends TestIntegrationBase {
                                     // The second invoice should be adjusted for the AO (we paid for the full period) and since we paid we should also see a CBA
                                     new ExpectedInvoiceItemCheck(new LocalDate(2012, 4, 1), new LocalDate(2012, 5, 1), InvoiceItemType.REPAIR_ADJ, new BigDecimal("-399.95")),
                                     new ExpectedInvoiceItemCheck(new LocalDate(2012, 4, 1), new LocalDate(2012, 4, 1), InvoiceItemType.CBA_ADJ, new BigDecimal("399.95")));
-        entitlementChecker.checkBundleAuditUpdated(bundle.getId(), callContext);
+        subscriptionChecker.checkBundleAuditUpdated(bundle.getId(), callContext);
 
     }
 
diff --git a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestIntegrationBase.java b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestIntegrationBase.java
index dfac0ab..130c3df 100644
--- a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestIntegrationBase.java
+++ b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestIntegrationBase.java
@@ -46,7 +46,7 @@ import com.ning.billing.beatrix.glue.BeatrixModule;
 import com.ning.billing.beatrix.lifecycle.Lifecycle;
 import com.ning.billing.beatrix.osgi.SetupBundleWithAssertion;
 import com.ning.billing.beatrix.util.AccountChecker;
-import com.ning.billing.beatrix.util.EntitlementChecker;
+import com.ning.billing.beatrix.util.SubscriptionChecker;
 import com.ning.billing.beatrix.util.InvoiceChecker;
 import com.ning.billing.beatrix.util.PaymentChecker;
 import com.ning.billing.beatrix.util.RefundChecker;
@@ -56,8 +56,6 @@ import com.ning.billing.catalog.api.Currency;
 import com.ning.billing.catalog.api.PlanPhaseSpecifier;
 import com.ning.billing.catalog.api.PriceListSet;
 import com.ning.billing.catalog.api.ProductCategory;
-import com.ning.billing.subscription.api.SubscriptionService;
-import com.ning.billing.subscription.api.user.SubscriptionData;
 import com.ning.billing.invoice.api.Invoice;
 import com.ning.billing.invoice.api.InvoiceApiException;
 import com.ning.billing.invoice.api.InvoicePayment;
@@ -76,9 +74,11 @@ import com.ning.billing.payment.api.PaymentMethodKVInfo;
 import com.ning.billing.payment.api.PaymentMethodPlugin;
 import com.ning.billing.payment.api.TestPaymentMethodPluginBase;
 import com.ning.billing.payment.provider.MockPaymentProviderPlugin;
+import com.ning.billing.subscription.api.SubscriptionService;
 import com.ning.billing.subscription.api.timeline.SubscriptionTimelineApi;
 import com.ning.billing.subscription.api.transfer.SubscriptionTransferApi;
 import com.ning.billing.subscription.api.user.Subscription;
+import com.ning.billing.subscription.api.user.SubscriptionData;
 import com.ning.billing.subscription.api.user.SubscriptionUserApi;
 import com.ning.billing.subscription.api.user.SubscriptionUserApiException;
 import com.ning.billing.util.api.RecordIdApi;
@@ -189,7 +189,7 @@ public class TestIntegrationBase extends BeatrixTestSuiteWithEmbeddedDB implemen
     protected RefundChecker refundChecker;
 
     @Inject
-    protected EntitlementChecker entitlementChecker;
+    protected SubscriptionChecker subscriptionChecker;
 
     @Inject
     protected AccountInternalApi accountInternalApi;
diff --git a/invoice/src/main/java/com/ning/billing/invoice/InvoiceListener.java b/invoice/src/main/java/com/ning/billing/invoice/InvoiceListener.java
index b0851c3..896d688 100644
--- a/invoice/src/main/java/com/ning/billing/invoice/InvoiceListener.java
+++ b/invoice/src/main/java/com/ning/billing/invoice/InvoiceListener.java
@@ -29,7 +29,7 @@ import com.ning.billing.util.callcontext.InternalCallContext;
 import com.ning.billing.util.callcontext.InternalCallContextFactory;
 import com.ning.billing.util.callcontext.UserType;
 import com.ning.billing.util.events.EffectiveSubscriptionInternalEvent;
-import com.ning.billing.util.events.RepairEntitlementInternalEvent;
+import com.ning.billing.util.events.RepairSubscriptionInternalEvent;
 
 import com.google.common.eventbus.Subscribe;
 import com.google.inject.Inject;
@@ -47,7 +47,7 @@ public class InvoiceListener {
     }
 
     @Subscribe
-    public void handleRepairEntitlementEvent(final RepairEntitlementInternalEvent event) {
+    public void handleRepairEntitlementEvent(final RepairSubscriptionInternalEvent event) {
 
         try {
             final InternalCallContext context = internalCallContextFactory.createInternalCallContext(event.getSearchKey2(), event.getSearchKey1(), "RepairBundle", CallOrigin.INTERNAL, UserType.SYSTEM, event.getUserToken());
diff --git a/junction/src/main/java/com/ning/billing/junction/glue/DefaultJunctionModule.java b/junction/src/main/java/com/ning/billing/junction/glue/DefaultJunctionModule.java
index d7da17d..d9e4722 100644
--- a/junction/src/main/java/com/ning/billing/junction/glue/DefaultJunctionModule.java
+++ b/junction/src/main/java/com/ning/billing/junction/glue/DefaultJunctionModule.java
@@ -28,7 +28,7 @@ import com.ning.billing.junction.block.DefaultBlockingChecker;
 import com.ning.billing.junction.dao.BlockingStateDao;
 import com.ning.billing.junction.dao.DefaultBlockingStateDao;
 import com.ning.billing.junction.plumbing.api.BlockingAccountUserApi;
-import com.ning.billing.junction.plumbing.api.BlockingEntitlementUserApi;
+import com.ning.billing.junction.plumbing.api.BlockingSubscriptionUserApi;
 import com.ning.billing.junction.plumbing.billing.BlockingCalculator;
 import com.ning.billing.junction.plumbing.billing.DefaultInternalBillingApi;
 import com.ning.billing.subscription.api.user.SubscriptionUserApi;
@@ -77,7 +77,7 @@ public class DefaultJunctionModule extends AbstractModule implements JunctionMod
     }
 
     public void installSubscriptionUserApi() {
-        bind(SubscriptionUserApi.class).to(BlockingEntitlementUserApi.class).asEagerSingleton();
+        bind(SubscriptionUserApi.class).to(BlockingSubscriptionUserApi.class).asEagerSingleton();
     }
 
     public void installBlockingApi() {

pom.xml 2(+1 -1)

diff --git a/pom.xml b/pom.xml
index 992cfec..fcdb4f2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
         <module>api</module>
         <module>beatrix</module>
         <module>catalog</module>
-        <module>entitlement</module>
+        <module>subscription</module>
         <module>invoice</module>
         <module>junction</module>
         <module>overdue</module>

server/pom.xml 8(+4 -4)

diff --git a/server/pom.xml b/server/pom.xml
index 598794e..15d1325 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -91,10 +91,6 @@
         </dependency>
         <dependency>
             <groupId>com.ning.billing</groupId>
-            <artifactId>killbill-entitlement</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.ning.billing</groupId>
             <artifactId>killbill-invoice</artifactId>
         </dependency>
         <dependency>
@@ -125,6 +121,10 @@
         </dependency>
         <dependency>
             <groupId>com.ning.billing</groupId>
+            <artifactId>killbill-subscription</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.ning.billing</groupId>
             <artifactId>killbill-tenant</artifactId>
         </dependency>
         <dependency>
diff --git a/util/src/test/java/com/ning/billing/api/TestApiListener.java b/util/src/test/java/com/ning/billing/api/TestApiListener.java
index e01ff24..38a9de7 100644
--- a/util/src/test/java/com/ning/billing/api/TestApiListener.java
+++ b/util/src/test/java/com/ning/billing/api/TestApiListener.java
@@ -29,7 +29,7 @@ import com.ning.billing.util.events.InvoiceCreationInternalEvent;
 import com.ning.billing.util.events.PaymentErrorInternalEvent;
 import com.ning.billing.util.events.PaymentInfoInternalEvent;
 import com.ning.billing.util.events.PaymentPluginErrorInternalEvent;
-import com.ning.billing.util.events.RepairEntitlementInternalEvent;
+import com.ning.billing.util.events.RepairSubscriptionInternalEvent;
 import com.ning.billing.util.events.TagDefinitionInternalEvent;
 import com.ning.billing.util.events.TagInternalEvent;
 import org.joda.time.DateTime;
@@ -89,7 +89,7 @@ public class TestApiListener {
     }
 
     @Subscribe
-    public void handleRepairEntitlementEvents(final RepairEntitlementInternalEvent event) {
+    public void handleRepairEntitlementEvents(final RepairSubscriptionInternalEvent event) {
         log.info(String.format("Got RepairEntitlementEvent event %s", event.toString()));
         assertEqualsNicely(NextEvent.REPAIR_BUNDLE);
         notifyIfStackEmpty();