killbill-memoizeit

audit work (clean up test failures; add mocks for next billing

3/21/2012 5:35:26 PM

Changes

util/src/main/java/com/ning/billing/util/tag/dao/TagDao.java 4(+0 -4)

Details

diff --git a/account/src/main/resources/com/ning/billing/account/dao/AccountSqlDao.sql.stg b/account/src/main/resources/com/ning/billing/account/dao/AccountSqlDao.sql.stg
index f27cd2c..2838ef8 100644
--- a/account/src/main/resources/com/ning/billing/account/dao/AccountSqlDao.sql.stg
+++ b/account/src/main/resources/com/ning/billing/account/dao/AccountSqlDao.sql.stg
@@ -18,7 +18,7 @@ accountFields(prefix) ::= <<
 	<prefix>state_or_province, 
     <prefix>country, 
     <prefix>postal_code,
-    <prefix>phone,	
+    <prefix>phone,
     <prefix>created_by,
     <prefix>created_date,
     <prefix>updated_by,
@@ -42,7 +42,7 @@ update() ::= <<
         time_zone = :timeZone, locale = :locale,
         address1 = :address1, address2 = :address2, company_name = :companyName, city = :city, state_or_province = :stateOrProvince,
         country = :country, postal_code = :postalCode, phone = :phone,
-        updated_date = :date, updated_by = :userName
+        updated_date = :updatedDate, updated_by = :userName
     WHERE id = :id;
 >>
 
diff --git a/account/src/test/java/com/ning/billing/account/glue/AccountModuleWithEmbeddedDb.java b/account/src/test/java/com/ning/billing/account/glue/AccountModuleWithEmbeddedDb.java
index 1a894a7..9ed15a3 100644
--- a/account/src/test/java/com/ning/billing/account/glue/AccountModuleWithEmbeddedDb.java
+++ b/account/src/test/java/com/ning/billing/account/glue/AccountModuleWithEmbeddedDb.java
@@ -19,6 +19,7 @@ package com.ning.billing.account.glue;
 import com.ning.billing.dbi.MysqlTestingHelper;
 import com.ning.billing.util.clock.MockClockModule;
 import com.ning.billing.util.glue.BusModule;
+import com.ning.billing.util.glue.CallContextModule;
 import org.skife.jdbi.v2.IDBI;
 
 import java.io.IOException;
@@ -41,8 +42,9 @@ public class AccountModuleWithEmbeddedDb extends AccountModule {
     @Override
     protected void configure() {
         bind(IDBI.class).toInstance(helper.getDBI());
-        super.configure();
         install(new BusModule());
         install(new MockClockModule());
+        install(new CallContextModule());
+        super.configure();
     }
 }
diff --git a/invoice/src/main/java/com/ning/billing/invoice/dao/DefaultInvoiceDao.java b/invoice/src/main/java/com/ning/billing/invoice/dao/DefaultInvoiceDao.java
index 113d8ee..7b4ed71 100644
--- a/invoice/src/main/java/com/ning/billing/invoice/dao/DefaultInvoiceDao.java
+++ b/invoice/src/main/java/com/ning/billing/invoice/dao/DefaultInvoiceDao.java
@@ -52,12 +52,12 @@ public class DefaultInvoiceDao implements InvoiceDao {
 
     private final Bus eventBus;
 
-	private NextBillingDatePoster nextBillingDatePoster;
+	private final  NextBillingDatePoster nextBillingDatePoster;
 
     @Inject
     public DefaultInvoiceDao(final IDBI dbi, final Bus eventBus,
                              final EntitlementBillingApi entitlementBillingApi,
-                             NextBillingDatePoster nextBillingDatePoster) {
+                             final NextBillingDatePoster nextBillingDatePoster) {
         this.invoiceSqlDao = dbi.onDemand(InvoiceSqlDao.class);
         this.invoicePaymentSqlDao = dbi.onDemand(InvoicePaymentSqlDao.class);
         this.eventBus = eventBus;
diff --git a/invoice/src/test/java/com/ning/billing/invoice/glue/InvoiceModuleWithEmbeddedDb.java b/invoice/src/test/java/com/ning/billing/invoice/glue/InvoiceModuleWithEmbeddedDb.java
index b6cd172..49e2263 100644
--- a/invoice/src/test/java/com/ning/billing/invoice/glue/InvoiceModuleWithEmbeddedDb.java
+++ b/invoice/src/test/java/com/ning/billing/invoice/glue/InvoiceModuleWithEmbeddedDb.java
@@ -23,6 +23,10 @@ import com.ning.billing.invoice.api.test.InvoiceTestApi;
 import com.ning.billing.invoice.api.test.DefaultInvoiceTestApi;
 import com.ning.billing.invoice.dao.InvoicePaymentSqlDao;
 import com.ning.billing.invoice.dao.RecurringInvoiceItemSqlDao;
+import com.ning.billing.invoice.notification.MockNextBillingDateNotifier;
+import com.ning.billing.invoice.notification.MockNextBillingDatePoster;
+import com.ning.billing.invoice.notification.NextBillingDateNotifier;
+import com.ning.billing.invoice.notification.NextBillingDatePoster;
 import com.ning.billing.util.callcontext.CallContextFactory;
 import com.ning.billing.util.callcontext.DefaultCallContextFactory;
 import com.ning.billing.util.glue.CallContextModule;
@@ -73,6 +77,12 @@ public class InvoiceModuleWithEmbeddedDb extends InvoiceModule {
     }
 
     @Override
+    protected void installNotifier() {
+        bind(NextBillingDateNotifier.class).to(MockNextBillingDateNotifier.class).asEagerSingleton();
+        bind(NextBillingDatePoster.class).to(MockNextBillingDatePoster.class).asEagerSingleton();
+    }
+
+    @Override
     public void configure() {
         loadSystemPropertiesFromClasspath("/resource.properties");
 
diff --git a/invoice/src/test/java/com/ning/billing/invoice/glue/InvoiceModuleWithMocks.java b/invoice/src/test/java/com/ning/billing/invoice/glue/InvoiceModuleWithMocks.java
index 8f2acc9..336ec10 100644
--- a/invoice/src/test/java/com/ning/billing/invoice/glue/InvoiceModuleWithMocks.java
+++ b/invoice/src/test/java/com/ning/billing/invoice/glue/InvoiceModuleWithMocks.java
@@ -51,7 +51,8 @@ public class InvoiceModuleWithMocks extends InvoiceModule {
     protected void installInvoiceService() {
 
     }
-    
+
+    @Override
     protected void installInvoiceMigrationApi() {
 
     }
diff --git a/invoice/src/test/java/com/ning/billing/invoice/notification/MockNextBillingDateNotifier.java b/invoice/src/test/java/com/ning/billing/invoice/notification/MockNextBillingDateNotifier.java
new file mode 100644
index 0000000..87b5409
--- /dev/null
+++ b/invoice/src/test/java/com/ning/billing/invoice/notification/MockNextBillingDateNotifier.java
@@ -0,0 +1,18 @@
+package com.ning.billing.invoice.notification;
+
+public class MockNextBillingDateNotifier implements NextBillingDateNotifier {
+    @Override
+    public void initialize() {
+        // do nothing
+    }
+
+    @Override
+    public void start() {
+        // do nothing
+    }
+
+    @Override
+    public void stop() {
+        // do nothing
+    }
+}
diff --git a/invoice/src/test/java/com/ning/billing/invoice/notification/MockNextBillingDatePoster.java b/invoice/src/test/java/com/ning/billing/invoice/notification/MockNextBillingDatePoster.java
new file mode 100644
index 0000000..6867f3b
--- /dev/null
+++ b/invoice/src/test/java/com/ning/billing/invoice/notification/MockNextBillingDatePoster.java
@@ -0,0 +1,13 @@
+package com.ning.billing.invoice.notification;
+
+import org.joda.time.DateTime;
+import org.skife.jdbi.v2.sqlobject.mixins.Transmogrifier;
+
+import java.util.UUID;
+
+public class MockNextBillingDatePoster implements NextBillingDatePoster {
+    @Override
+    public void insertNextBillingNotification(Transmogrifier transactionalDao, UUID subscriptionId, DateTime futureNotificationTime) {
+        // do nothing
+    }
+}
diff --git a/util/src/main/java/com/ning/billing/util/customfield/CustomFieldBinder.java b/util/src/main/java/com/ning/billing/util/customfield/CustomFieldBinder.java
index 79fd6ad..0f27198 100644
--- a/util/src/main/java/com/ning/billing/util/customfield/CustomFieldBinder.java
+++ b/util/src/main/java/com/ning/billing/util/customfield/CustomFieldBinder.java
@@ -1,3 +1,19 @@
+/*
+ * 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.util.customfield;
 
 import org.skife.jdbi.v2.SQLStatement;
diff --git a/util/src/main/java/com/ning/billing/util/customfield/CustomFieldMapper.java b/util/src/main/java/com/ning/billing/util/customfield/CustomFieldMapper.java
index 1a84434..97d469d 100644
--- a/util/src/main/java/com/ning/billing/util/customfield/CustomFieldMapper.java
+++ b/util/src/main/java/com/ning/billing/util/customfield/CustomFieldMapper.java
@@ -1,3 +1,19 @@
+/*
+ * 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.util.customfield;
 
 import com.ning.billing.util.entity.MapperBase;
diff --git a/util/src/main/java/com/ning/billing/util/customfield/dao/AuditedCustomFieldDao.java b/util/src/main/java/com/ning/billing/util/customfield/dao/AuditedCustomFieldDao.java
index 096dfbe..5b5b864 100644
--- a/util/src/main/java/com/ning/billing/util/customfield/dao/AuditedCustomFieldDao.java
+++ b/util/src/main/java/com/ning/billing/util/customfield/dao/AuditedCustomFieldDao.java
@@ -1,3 +1,19 @@
+/*
+ * 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.util.customfield.dao;
 
 import com.ning.billing.util.callcontext.CallContext;
diff --git a/util/src/main/java/com/ning/billing/util/customfield/dao/CustomFieldAuditSqlDao.java b/util/src/main/java/com/ning/billing/util/customfield/dao/CustomFieldAuditSqlDao.java
index 0bd7085..5cbf937 100644
--- a/util/src/main/java/com/ning/billing/util/customfield/dao/CustomFieldAuditSqlDao.java
+++ b/util/src/main/java/com/ning/billing/util/customfield/dao/CustomFieldAuditSqlDao.java
@@ -1,3 +1,19 @@
+/*
+ * 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.util.customfield.dao;
 
 import com.ning.billing.util.callcontext.CallContext;
diff --git a/util/src/main/java/com/ning/billing/util/entity/BinderBase.java b/util/src/main/java/com/ning/billing/util/entity/BinderBase.java
index ec516ed..8839541 100644
--- a/util/src/main/java/com/ning/billing/util/entity/BinderBase.java
+++ b/util/src/main/java/com/ning/billing/util/entity/BinderBase.java
@@ -1,3 +1,19 @@
+/*
+ * 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.util.entity;
 
 import org.joda.time.DateTime;
diff --git a/util/src/main/java/com/ning/billing/util/entity/MapperBase.java b/util/src/main/java/com/ning/billing/util/entity/MapperBase.java
index ce08d3b..e2902d8 100644
--- a/util/src/main/java/com/ning/billing/util/entity/MapperBase.java
+++ b/util/src/main/java/com/ning/billing/util/entity/MapperBase.java
@@ -1,3 +1,19 @@
+/*
+ * 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.util.entity;
 
 import org.joda.time.DateTime;
diff --git a/util/src/main/java/com/ning/billing/util/entity/UpdatableEntityCollectionDao.java b/util/src/main/java/com/ning/billing/util/entity/UpdatableEntityCollectionDao.java
index 18314fa..ed27853 100644
--- a/util/src/main/java/com/ning/billing/util/entity/UpdatableEntityCollectionDao.java
+++ b/util/src/main/java/com/ning/billing/util/entity/UpdatableEntityCollectionDao.java
@@ -1,3 +1,19 @@
+/*
+ * 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.util.entity;
 
 import com.ning.billing.util.callcontext.CallContext;
diff --git a/util/src/main/java/com/ning/billing/util/tag/dao/AuditedTagDao.java b/util/src/main/java/com/ning/billing/util/tag/dao/AuditedTagDao.java
index a1bb4f3..257a531 100644
--- a/util/src/main/java/com/ning/billing/util/tag/dao/AuditedTagDao.java
+++ b/util/src/main/java/com/ning/billing/util/tag/dao/AuditedTagDao.java
@@ -1,3 +1,19 @@
+/*
+ * 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.util.tag.dao;
 
 import com.ning.billing.util.callcontext.CallContext;
diff --git a/util/src/main/java/com/ning/billing/util/tag/dao/TagAuditSqlDao.java b/util/src/main/java/com/ning/billing/util/tag/dao/TagAuditSqlDao.java
index 1032179..55cc732 100644
--- a/util/src/main/java/com/ning/billing/util/tag/dao/TagAuditSqlDao.java
+++ b/util/src/main/java/com/ning/billing/util/tag/dao/TagAuditSqlDao.java
@@ -1,5 +1,20 @@
-package com.ning.billing.util.tag.dao;
+/*
+ * 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.util.tag.dao;
 
 import com.ning.billing.util.callcontext.CallContext;
 import com.ning.billing.util.callcontext.CallContextBinder;