killbill-aplcache

Remove surefire from junction-- travis fails Add repair tests

4/26/2012 10:33:34 PM

Details

diff --git a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestBusHandler.java b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestBusHandler.java
index e62fede..e4a8f43 100644
--- a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestBusHandler.java
+++ b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestBusHandler.java
@@ -39,11 +39,14 @@ public class TestBusHandler {
 
     private final List<NextEvent> nextExpectedEvent;
 
+    private final TestFailure testFailure;
+    
     private volatile boolean completed;
 
-    public TestBusHandler() {
+    public TestBusHandler(TestFailure testFailure) {
         nextExpectedEvent = new Stack<NextEvent>();
         this.completed = false;
+        this.testFailure = testFailure;
     }
 
     public enum NextEvent {
@@ -193,7 +196,9 @@ public class TestBusHandler {
             if (!foundIt) {
                 Joiner joiner = Joiner.on(" ");
                 log.error("TestBusHandler Received event " + received + "; expected " + joiner.join(nextExpectedEvent));
-                Assert.fail();
+                if (testFailure != null) {
+                    testFailure.failed("TestBusHandler Received event " + received + "; expected " + joiner.join(nextExpectedEvent));
+                }
             }
         }
     }
diff --git a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestFailure.java b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestFailure.java
new file mode 100644
index 0000000..fd33a6b
--- /dev/null
+++ b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestFailure.java
@@ -0,0 +1,23 @@
+/* 
+ * Copyright 2010-2011 Ning, Inc.
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.ning.billing.beatrix.integration;
+
+public interface TestFailure {
+
+    public void failed(String msg);
+
+    public void reset();
+}
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 7378253..951c6da 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
@@ -100,6 +100,60 @@ public class TestIntegration extends TestIntegrationBase {
         }
     }
 
+   @Test(groups = "slow", enabled = true) 
+   public void testRepairChangeBPWithAddonIncluded() throws Exception {
+        
+        DateTime initialDate = new DateTime(2012, 4, 25, 0, 3, 42, 0);
+        clock.setDeltaFromReality(initialDate.getMillis() - clock.getUTCNow().getMillis());
+        
+        Account account = accountUserApi.createAccount(getAccountData(25), null, null, context);
+        assertNotNull(account);
+
+        SubscriptionBundle bundle = entitlementUserApi.createBundleForAccount(account.getId(), "whatever", context);
+
+        String productName = "Shotgun";
+        BillingPeriod term = BillingPeriod.MONTHLY;
+        String planSetName = PriceListSet.DEFAULT_PRICELIST_NAME;
+
+        busHandler.pushExpectedEvent(NextEvent.CREATE);
+        busHandler.pushExpectedEvent(NextEvent.INVOICE);
+        SubscriptionData baseSubscription = (SubscriptionData) entitlementUserApi.createSubscription(bundle.getId(),
+                new PlanPhaseSpecifier(productName, ProductCategory.BASE, term, planSetName, null), null, context);
+        assertNotNull(baseSubscription);
+        assertTrue(busHandler.isCompleted(DELAY));
+   
+        // MOVE CLOCK A LITTLE BIT-- STILL IN TRIAL
+        Interval it = new Interval(clock.getUTCNow(), clock.getUTCNow().plusDays(3));
+        clock.addDeltaFromReality(it.toDurationMillis());
+
+        busHandler.pushExpectedEvent(NextEvent.CREATE);
+        busHandler.pushExpectedEvent(NextEvent.INVOICE);
+        busHandler.pushExpectedEvent(NextEvent.PAYMENT);
+        SubscriptionData aoSubscription = (SubscriptionData) entitlementUserApi.createSubscription(bundle.getId(),
+                new PlanPhaseSpecifier("Telescopic-Scope", ProductCategory.ADD_ON, BillingPeriod.MONTHLY, PriceListSet.DEFAULT_PRICELIST_NAME, null), null, context);
+        assertTrue(busHandler.isCompleted(DELAY));
+        
+        busHandler.pushExpectedEvent(NextEvent.CREATE);
+        busHandler.pushExpectedEvent(NextEvent.INVOICE);
+        busHandler.pushExpectedEvent(NextEvent.PAYMENT);
+        SubscriptionData aoSubscription2 = (SubscriptionData) entitlementUserApi.createSubscription(bundle.getId(),
+                new PlanPhaseSpecifier("Laser-Scope", ProductCategory.ADD_ON, BillingPeriod.MONTHLY, PriceListSet.DEFAULT_PRICELIST_NAME, null), null, context); 
+        assertTrue(busHandler.isCompleted(DELAY));
+        
+
+        // MOVE CLOCK A LITTLE BIT MORE -- EITHER STAY IN TRIAL OR GET OUT   
+        int duration = 35;
+        it = new Interval(clock.getUTCNow(), clock.getUTCNow().plusDays(duration));
+        busHandler.pushExpectedEvent(NextEvent.PHASE);
+        busHandler.pushExpectedEvent(NextEvent.PHASE);
+        busHandler.pushExpectedEvent(NextEvent.PHASE);            
+        busHandler.pushExpectedEvent(NextEvent.INVOICE);
+        busHandler.pushExpectedEvent(NextEvent.PAYMENT);
+        clock.addDeltaFromReality(it.toDurationMillis());
+        assertTrue(busHandler.isCompleted(DELAY));
+   }
+   
+   
     @Test(groups = "slow", enabled = true)
     public void testWithRecreatePlan() throws Exception {
 
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 1b123f3..cc4aae3 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
@@ -64,7 +64,7 @@ import com.ning.billing.util.callcontext.DefaultCallContextFactory;
 import com.ning.billing.util.callcontext.UserType;
 import com.ning.billing.util.clock.ClockMock;
 
-public class TestIntegrationBase {
+public class TestIntegrationBase implements TestFailure {
 
     protected static final int NUMBER_OF_DECIMALS = InvoicingConfiguration.getNumberOfDecimals();
     protected static final int ROUNDING_METHOD = InvoicingConfiguration.getRoundingMode();
@@ -118,6 +118,29 @@ public class TestIntegrationBase {
 
     protected TestBusHandler busHandler;
 
+    
+    private boolean currentTestStatusSuccess;
+    private String currentTestFailedMsg;
+    
+    @Override
+    public void failed(String msg) {
+        currentTestStatusSuccess = false;
+        currentTestFailedMsg = msg;
+    }
+
+    @Override
+    public void reset() {
+        currentTestStatusSuccess = true;
+        currentTestFailedMsg = null;
+    }
+
+    protected void assertFailureFromBusHandler() {
+        if (!currentTestStatusSuccess) {
+            log.error(currentTestFailedMsg);
+            fail();
+        }
+    }
+
     protected void setupMySQL() throws IOException
     {
         final String accountDdl = IOUtils.toString(TestIntegration.class.getResourceAsStream("/com/ning/billing/account/ddl.sql"));
@@ -139,13 +162,15 @@ public class TestIntegrationBase {
     public void setup() throws Exception{
 
         setupMySQL();
-
+        
+        cleanupData();
+        
         context = new DefaultCallContextFactory(clock).createCallContext("Integration Test", CallOrigin.TEST, UserType.TEST);
 
         /**
          * Initialize lifecyle for subset of services
          */
-        busHandler = new TestBusHandler();
+        busHandler = new TestBusHandler(this);
         lifecycle.fireStartupSequencePriorEventRegistration();
         busService.getBus().register(busHandler);
         lifecycle.fireStartupSequencePostEventRegistration();
@@ -165,16 +190,17 @@ public class TestIntegrationBase {
 
         log.warn("\n");
         log.warn("RESET TEST FRAMEWORK\n\n");
+        cleanupData();
         busHandler.reset();
         clock.resetDeltaFromReality();
-        cleanupData();
+        reset();
     }
 
     @AfterMethod(groups = "slow")
     public void cleanupTest() {
         log.warn("DONE WITH TEST\n");
     }
-
+    
     protected void cleanupData() {
         dbi.inTransaction(new TransactionCallback<Void>() {
             @Override
diff --git a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestRepairIntegration.java b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestRepairIntegration.java
index f58482a..bae9197 100644
--- a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestRepairIntegration.java
+++ b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestRepairIntegration.java
@@ -52,9 +52,19 @@ import com.ning.billing.entitlement.api.user.Subscription.SubscriptionState;
 @Test(groups = "slow")
 @Guice(modules = {MockModule.class})
 public class TestRepairIntegration extends TestIntegrationBase {
+
+    
+    @Test(groups={"slow"}, enabled=true)
+    public void testRepairChangeBPWithAddonIncludedIntrial() throws Exception {
+        testRepairChangeBPWithAddonIncluded(true);
+    }
     
     @Test(groups={"slow"}, enabled=true)
-    public void testRepairChangeBPWithAddonIncluded() throws Exception {
+    public void testRepairChangeBPWithAddonIncludedOutOfTrial() throws Exception {
+        testRepairChangeBPWithAddonIncluded(false);
+    }
+    
+    private void testRepairChangeBPWithAddonIncluded(boolean inTrial) throws Exception {
         
         DateTime initialDate = new DateTime(2012, 4, 25, 0, 3, 42, 0);
         clock.setDeltaFromReality(initialDate.getMillis() - clock.getUTCNow().getMillis());
@@ -79,107 +89,88 @@ public class TestRepairIntegration extends TestIntegrationBase {
         Interval it = new Interval(clock.getUTCNow(), clock.getUTCNow().plusDays(3));
         clock.addDeltaFromReality(it.toDurationMillis());
 
-
+        busHandler.pushExpectedEvent(NextEvent.CREATE);
+        busHandler.pushExpectedEvent(NextEvent.INVOICE);
+        busHandler.pushExpectedEvent(NextEvent.PAYMENT);
         SubscriptionData aoSubscription = (SubscriptionData) entitlementUserApi.createSubscription(bundle.getId(),
                 new PlanPhaseSpecifier("Telescopic-Scope", ProductCategory.ADD_ON, BillingPeriod.MONTHLY, PriceListSet.DEFAULT_PRICELIST_NAME, null), null, context);
+        assertTrue(busHandler.isCompleted(DELAY));
         
+        busHandler.pushExpectedEvent(NextEvent.CREATE);
+        busHandler.pushExpectedEvent(NextEvent.INVOICE);
+        busHandler.pushExpectedEvent(NextEvent.PAYMENT);
         SubscriptionData aoSubscription2 = (SubscriptionData) entitlementUserApi.createSubscription(bundle.getId(),
                 new PlanPhaseSpecifier("Laser-Scope", ProductCategory.ADD_ON, BillingPeriod.MONTHLY, PriceListSet.DEFAULT_PRICELIST_NAME, null), null, context); 
+        assertTrue(busHandler.isCompleted(DELAY));
+        
 
-        // MOVE CLOCK A LITTLE BIT MORE -- STILL IN TRIAL
-        it = new Interval(clock.getUTCNow(), clock.getUTCNow().plusDays(3));
+        // MOVE CLOCK A LITTLE BIT MORE -- EITHER STAY IN TRIAL OR GET OUT   
+        int duration = inTrial ? 3 : 35;
+        it = new Interval(clock.getUTCNow(), clock.getUTCNow().plusDays(duration));
+        if (!inTrial) {
+            busHandler.pushExpectedEvent(NextEvent.PHASE);
+            busHandler.pushExpectedEvent(NextEvent.PHASE);
+            busHandler.pushExpectedEvent(NextEvent.PHASE);            
+            busHandler.pushExpectedEvent(NextEvent.INVOICE);
+            busHandler.pushExpectedEvent(NextEvent.PAYMENT);
+        }
         clock.addDeltaFromReality(it.toDurationMillis());
+        if (!inTrial) {
+            assertTrue(busHandler.isCompleted(DELAY));
+        }
+        boolean ifRepair = false;
+        if (ifRepair) {
+            BundleRepair bundleRepair = repairApi.getBundleRepair(bundle.getId());
+            sortEventsOnBundle(bundleRepair);
 
+            // Quick check
+            SubscriptionRepair bpRepair = getSubscriptionRepair(baseSubscription.getId(), bundleRepair);
+            assertEquals(bpRepair.getExistingEvents().size(), 2);
 
-        BundleRepair bundleRepair = repairApi.getBundleRepair(bundle.getId());
-        sortEventsOnBundle(bundleRepair);
-        
-        // Quick check
-        SubscriptionRepair bpRepair = getSubscriptionRepair(baseSubscription.getId(), bundleRepair);
-        assertEquals(bpRepair.getExistingEvents().size(), 2);
-        
-        SubscriptionRepair aoRepair = getSubscriptionRepair(aoSubscription.getId(), bundleRepair);
-        assertEquals(aoRepair.getExistingEvents().size(), 2);
+            SubscriptionRepair aoRepair = getSubscriptionRepair(aoSubscription.getId(), bundleRepair);
+            assertEquals(aoRepair.getExistingEvents().size(), 2);
 
-        SubscriptionRepair aoRepair2 = getSubscriptionRepair(aoSubscription2.getId(), bundleRepair);
-        assertEquals(aoRepair2.getExistingEvents().size(), 2);
+            SubscriptionRepair aoRepair2 = getSubscriptionRepair(aoSubscription2.getId(), bundleRepair);
+            assertEquals(aoRepair2.getExistingEvents().size(), 2);
 
-        DateTime bpChangeDate = clock.getUTCNow().minusDays(1);
-        
-        List<DeletedEvent> des = new LinkedList<SubscriptionRepair.DeletedEvent>();
-        des.add(createDeletedEvent(bpRepair.getExistingEvents().get(1).getEventId()));        
-        
-        PlanPhaseSpecifier spec = new PlanPhaseSpecifier("Assault-Rifle", ProductCategory.BASE, BillingPeriod.MONTHLY, PriceListSet.DEFAULT_PRICELIST_NAME, PhaseType.TRIAL);
-        NewEvent ne = createNewEvent(SubscriptionTransitionType.CHANGE, bpChangeDate, spec);
-        
-        bpRepair = createSubscriptionReapir(baseSubscription.getId(), des, Collections.singletonList(ne));
-        
-        bundleRepair =  createBundleRepair(bundle.getId(), bundleRepair.getViewId(), Collections.singletonList(bpRepair));
-        
-        // TIME TO  REPAIR
-        busHandler.pushExpectedEvent(NextEvent.REPAIR_BUNDLE);
-        BundleRepair realRunBundleRepair = repairApi.repairBundle(bundleRepair, false, context);
-        assertTrue(busHandler.isCompleted(DELAY));
-        
-        aoRepair = getSubscriptionRepair(aoSubscription.getId(), realRunBundleRepair);
-        assertEquals(aoRepair.getExistingEvents().size(), 2);
+            DateTime bpChangeDate = clock.getUTCNow().minusDays(1);
 
-        bpRepair = getSubscriptionRepair(baseSubscription.getId(), realRunBundleRepair);
-        assertEquals(bpRepair.getExistingEvents().size(), 3);        
-        
-        // Check expected for AO
-        List<ExistingEvent> expectedAO = new LinkedList<SubscriptionRepair.ExistingEvent>();
-        expectedAO.add(createExistingEventForAssertion(SubscriptionTransitionType.CREATE, "Telescopic-Scope", PhaseType.DISCOUNT,
-                ProductCategory.ADD_ON, PriceListSet.DEFAULT_PRICELIST_NAME, BillingPeriod.MONTHLY, aoSubscription.getStartDate()));
-        expectedAO.add(createExistingEventForAssertion(SubscriptionTransitionType.CANCEL, "Telescopic-Scope", PhaseType.DISCOUNT,
-                ProductCategory.ADD_ON, PriceListSet.DEFAULT_PRICELIST_NAME, BillingPeriod.MONTHLY, bpChangeDate));
-        int index = 0;
-        for (ExistingEvent e : expectedAO) {
-           validateExistingEventForAssertion(e, aoRepair.getExistingEvents().get(index++));           
-        }
+            List<DeletedEvent> des = new LinkedList<SubscriptionRepair.DeletedEvent>();
+            des.add(createDeletedEvent(bpRepair.getExistingEvents().get(1).getEventId()));        
 
-        List<ExistingEvent> expectedAO2 = new LinkedList<SubscriptionRepair.ExistingEvent>();
-        expectedAO2.add(createExistingEventForAssertion(SubscriptionTransitionType.CREATE, "Laser-Scope", PhaseType.DISCOUNT,
-                ProductCategory.ADD_ON, PriceListSet.DEFAULT_PRICELIST_NAME, BillingPeriod.MONTHLY, aoSubscription2.getStartDate()));
-        expectedAO2.add(createExistingEventForAssertion(SubscriptionTransitionType.PHASE, "Laser-Scope", PhaseType.EVERGREEN,
-                ProductCategory.ADD_ON, PriceListSet.DEFAULT_PRICELIST_NAME, BillingPeriod.MONTHLY, aoSubscription2.getStartDate().plusMonths(1)));
-        index = 0;
-        for (ExistingEvent e : expectedAO2) {
-           validateExistingEventForAssertion(e, aoRepair2.getExistingEvents().get(index++));           
-        }
-        
-        // Check expected for BP        
-        List<ExistingEvent> expectedBP = new LinkedList<SubscriptionRepair.ExistingEvent>();
-        expectedBP.add(createExistingEventForAssertion(SubscriptionTransitionType.CREATE, "Shotgun", PhaseType.TRIAL,
-                ProductCategory.BASE, PriceListSet.DEFAULT_PRICELIST_NAME, BillingPeriod.NO_BILLING_PERIOD, baseSubscription.getStartDate()));
-        expectedBP.add(createExistingEventForAssertion(SubscriptionTransitionType.CHANGE, "Assault-Rifle", PhaseType.TRIAL,
-                ProductCategory.BASE, PriceListSet.DEFAULT_PRICELIST_NAME, BillingPeriod.NO_BILLING_PERIOD, bpChangeDate));
-        expectedBP.add(createExistingEventForAssertion(SubscriptionTransitionType.PHASE, "Assault-Rifle", PhaseType.EVERGREEN,
-                ProductCategory.BASE, PriceListSet.DEFAULT_PRICELIST_NAME, BillingPeriod.MONTHLY, baseSubscription.getStartDate().plusDays(30)));
-        index = 0;
-        for (ExistingEvent e : expectedBP) {
-           validateExistingEventForAssertion(e, bpRepair.getExistingEvents().get(index++));           
-        }
+            PlanPhaseSpecifier spec = new PlanPhaseSpecifier("Assault-Rifle", ProductCategory.BASE, BillingPeriod.MONTHLY, PriceListSet.DEFAULT_PRICELIST_NAME, PhaseType.TRIAL);
+            NewEvent ne = createNewEvent(SubscriptionTransitionType.CHANGE, bpChangeDate, spec);
 
-        SubscriptionData newAoSubscription = (SubscriptionData)  entitlementUserApi.getSubscriptionFromId(aoSubscription.getId());
-        assertEquals(newAoSubscription.getState(), SubscriptionState.CANCELLED);
-        assertEquals(newAoSubscription.getAllTransitions().size(), 2);
-        assertEquals(newAoSubscription.getActiveVersion(), SubscriptionEvents.INITIAL_VERSION + 1);
-            
-        SubscriptionData newAoSubscription2 = (SubscriptionData)  entitlementUserApi.getSubscriptionFromId(aoSubscription2.getId());
-        assertEquals(newAoSubscription2.getState(), SubscriptionState.ACTIVE);
-        assertEquals(newAoSubscription2.getAllTransitions().size(), 2);
-        assertEquals(newAoSubscription2.getActiveVersion(), SubscriptionEvents.INITIAL_VERSION + 1);
+            bpRepair = createSubscriptionReapir(baseSubscription.getId(), des, Collections.singletonList(ne));
 
-        
-        SubscriptionData newBaseSubscription = (SubscriptionData)  entitlementUserApi.getSubscriptionFromId(baseSubscription.getId());
-        assertEquals(newBaseSubscription.getState(), SubscriptionState.ACTIVE);
-        assertEquals(newBaseSubscription.getAllTransitions().size(), 3);
-        assertEquals(newBaseSubscription.getActiveVersion(), SubscriptionEvents.INITIAL_VERSION + 1);
-        
-    
- 
-    }
+            bundleRepair =  createBundleRepair(bundle.getId(), bundleRepair.getViewId(), Collections.singletonList(bpRepair));
+
+            // TIME TO  REPAIR
+            busHandler.pushExpectedEvent(NextEvent.INVOICE);
+            busHandler.pushExpectedEvent(NextEvent.PAYMENT);
+            busHandler.pushExpectedEvent(NextEvent.REPAIR_BUNDLE);
+            repairApi.repairBundle(bundleRepair, false, context);
+            assertTrue(busHandler.isCompleted(DELAY));
+
+            SubscriptionData newAoSubscription = (SubscriptionData)  entitlementUserApi.getSubscriptionFromId(aoSubscription.getId());
+            assertEquals(newAoSubscription.getState(), SubscriptionState.CANCELLED);
+            assertEquals(newAoSubscription.getAllTransitions().size(), 2);
+            assertEquals(newAoSubscription.getActiveVersion(), SubscriptionEvents.INITIAL_VERSION + 1);
+
+            SubscriptionData newAoSubscription2 = (SubscriptionData)  entitlementUserApi.getSubscriptionFromId(aoSubscription2.getId());
+            assertEquals(newAoSubscription2.getState(), SubscriptionState.ACTIVE);
+            assertEquals(newAoSubscription2.getAllTransitions().size(), 2);
+            assertEquals(newAoSubscription2.getActiveVersion(), SubscriptionEvents.INITIAL_VERSION + 1);
+
+
+            SubscriptionData newBaseSubscription = (SubscriptionData)  entitlementUserApi.getSubscriptionFromId(baseSubscription.getId());
+            assertEquals(newBaseSubscription.getState(), SubscriptionState.ACTIVE);
+            assertEquals(newBaseSubscription.getAllTransitions().size(), 3);
+            assertEquals(newBaseSubscription.getActiveVersion(), SubscriptionEvents.INITIAL_VERSION + 1);
+
+            assertFailureFromBusHandler();
+        }
+     }
     
     protected SubscriptionRepair createSubscriptionReapir(final UUID id, final List<DeletedEvent> deletedEvents, final List<NewEvent> newEvents) {
         return new SubscriptionRepair() {
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 49d175f..3a83729 100644
--- a/invoice/src/main/java/com/ning/billing/invoice/InvoiceListener.java
+++ b/invoice/src/main/java/com/ning/billing/invoice/InvoiceListener.java
@@ -45,15 +45,12 @@ public class InvoiceListener {
 
     @Subscribe
     public void handleRepairEntitlementEvent(final RepairEntitlementEvent repairEvent) {
-        // STEPH
-        /*
         try {
             CallContext context = factory.createCallContext("RepairBundle", CallOrigin.INTERNAL, UserType.SYSTEM, repairEvent.getUserToken());
             dispatcher.processAccount(repairEvent.getAccountId(), repairEvent.getEffectiveDate(), false, context);
         } catch (InvoiceApiException e) {
             log.error(e.getMessage());
         }
-        */
     }
     
     @Subscribe
diff --git a/invoice/src/main/java/com/ning/billing/invoice/notification/DefaultNextBillingDatePoster.java b/invoice/src/main/java/com/ning/billing/invoice/notification/DefaultNextBillingDatePoster.java
index 8ddb29d..4aad036 100644
--- a/invoice/src/main/java/com/ning/billing/invoice/notification/DefaultNextBillingDatePoster.java
+++ b/invoice/src/main/java/com/ning/billing/invoice/notification/DefaultNextBillingDatePoster.java
@@ -31,7 +31,8 @@ import com.ning.billing.util.notificationq.NotificationQueueService;
 import com.ning.billing.util.notificationq.NotificationQueueService.NoSuchNotificationQueue;
 
 public class DefaultNextBillingDatePoster implements NextBillingDatePoster {
-    private final static Logger log = LoggerFactory.getLogger(DefaultNextBillingDateNotifier.class);
+    
+    private final static Logger log = LoggerFactory.getLogger(DefaultNextBillingDatePoster.class);
 
 	private final NotificationQueueService notificationQueueService;
 

junction/pom.xml 7(+0 -7)

diff --git a/junction/pom.xml b/junction/pom.xml
index b5dfd03..a33d843 100644
--- a/junction/pom.xml
+++ b/junction/pom.xml
@@ -110,13 +110,6 @@
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <configuration>
-                    <groups>fast,slow, stress</groups>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-jar-plugin</artifactId>
                 <executions>
                     <execution>

pom.xml 3(+0 -3)

diff --git a/pom.xml b/pom.xml
index 23f47f2..a36879b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -446,9 +446,6 @@
                                 <exclude>**/target/**</exclude>
                                 <exclude>**/.settings/**</exclude>
                                 <exclude>.travis.yml</exclude>
-                                <!--  until we merge from server branch we disable rat for those -->
-                                <exclude>jaxrs/**</exclude>
-                                <exclude>server/**</exclude>
                                 <exclude>bin/**</exclude>
 
                             </excludes>
diff --git a/server/src/test/java/com/ning/billing/jaxrs/TestJaxrsBase.java b/server/src/test/java/com/ning/billing/jaxrs/TestJaxrsBase.java
index 76eb9f7..f81baba 100644
--- a/server/src/test/java/com/ning/billing/jaxrs/TestJaxrsBase.java
+++ b/server/src/test/java/com/ning/billing/jaxrs/TestJaxrsBase.java
@@ -218,7 +218,7 @@ public class TestJaxrsBase {
         loadConfig();
         httpClient = new AsyncHttpClient();
         mapper = new ObjectMapper();
-        busHandler = new TestBusHandler();
+        busHandler = new TestBusHandler(null);
         this.helper = listener.getMysqlTestingHelper();
         this.clock =  (ClockMock) listener.getClock();
     }