killbill-uncached

Details

diff --git a/jaxrs/src/main/java/com/ning/billing/jaxrs/json/AccountJson.java b/jaxrs/src/main/java/com/ning/billing/jaxrs/json/AccountJson.java
index 42fc843..6d0664a 100644
--- a/jaxrs/src/main/java/com/ning/billing/jaxrs/json/AccountJson.java
+++ b/jaxrs/src/main/java/com/ning/billing/jaxrs/json/AccountJson.java
@@ -317,11 +317,149 @@ public class AccountJson extends JsonBase {
         return phone;
     }
 
+    @JsonProperty("isMigrated")
     public Boolean isMigrated() {
         return isMigrated;
     }
 
+    @JsonProperty("isNotifiedForInvoices")
     public Boolean isNotifiedForInvoices() {
         return isNotifiedForInvoices;
     }
+
+    @Override
+    public String toString() {
+        return "AccountJson{" +
+               "accountId='" + accountId + '\'' +
+               ", externalKey='" + externalKey + '\'' +
+               ", accountCBA=" + accountCBA +
+               ", accountBalance=" + accountBalance +
+               ", name='" + name + '\'' +
+               ", firstNameLength=" + firstNameLength +
+               ", email='" + email + '\'' +
+               ", billCycleDayLocal=" + billCycleDayLocal +
+               ", currency='" + currency + '\'' +
+               ", paymentMethodId='" + paymentMethodId + '\'' +
+               ", timeZone='" + timeZone + '\'' +
+               ", address1='" + address1 + '\'' +
+               ", address2='" + address2 + '\'' +
+               ", postalCode='" + postalCode + '\'' +
+               ", company='" + company + '\'' +
+               ", city='" + city + '\'' +
+               ", state='" + state + '\'' +
+               ", country='" + country + '\'' +
+               ", locale='" + locale + '\'' +
+               ", phone='" + phone + '\'' +
+               ", isMigrated=" + isMigrated +
+               ", isNotifiedForInvoices=" + isNotifiedForInvoices +
+               '}';
+    }
+
+    @Override
+    public boolean equals(final Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+
+        final AccountJson that = (AccountJson) o;
+
+        if (accountBalance != null ? accountBalance.compareTo(that.accountBalance) != 0 : that.accountBalance != null) {
+            return false;
+        }
+        if (accountCBA != null ? accountCBA.compareTo(that.accountCBA) != 0 : that.accountCBA != null) {
+            return false;
+        }
+        if (accountId != null ? !accountId.equals(that.accountId) : that.accountId != null) {
+            return false;
+        }
+        if (address1 != null ? !address1.equals(that.address1) : that.address1 != null) {
+            return false;
+        }
+        if (address2 != null ? !address2.equals(that.address2) : that.address2 != null) {
+            return false;
+        }
+        if (billCycleDayLocal != null ? !billCycleDayLocal.equals(that.billCycleDayLocal) : that.billCycleDayLocal != null) {
+            return false;
+        }
+        if (city != null ? !city.equals(that.city) : that.city != null) {
+            return false;
+        }
+        if (company != null ? !company.equals(that.company) : that.company != null) {
+            return false;
+        }
+        if (country != null ? !country.equals(that.country) : that.country != null) {
+            return false;
+        }
+        if (currency != null ? !currency.equals(that.currency) : that.currency != null) {
+            return false;
+        }
+        if (email != null ? !email.equals(that.email) : that.email != null) {
+            return false;
+        }
+        if (externalKey != null ? !externalKey.equals(that.externalKey) : that.externalKey != null) {
+            return false;
+        }
+        if (firstNameLength != null ? !firstNameLength.equals(that.firstNameLength) : that.firstNameLength != null) {
+            return false;
+        }
+        if (isMigrated != null ? !isMigrated.equals(that.isMigrated) : that.isMigrated != null) {
+            return false;
+        }
+        if (isNotifiedForInvoices != null ? !isNotifiedForInvoices.equals(that.isNotifiedForInvoices) : that.isNotifiedForInvoices != null) {
+            return false;
+        }
+        if (locale != null ? !locale.equals(that.locale) : that.locale != null) {
+            return false;
+        }
+        if (name != null ? !name.equals(that.name) : that.name != null) {
+            return false;
+        }
+        if (paymentMethodId != null ? !paymentMethodId.equals(that.paymentMethodId) : that.paymentMethodId != null) {
+            return false;
+        }
+        if (phone != null ? !phone.equals(that.phone) : that.phone != null) {
+            return false;
+        }
+        if (postalCode != null ? !postalCode.equals(that.postalCode) : that.postalCode != null) {
+            return false;
+        }
+        if (state != null ? !state.equals(that.state) : that.state != null) {
+            return false;
+        }
+        if (timeZone != null ? !timeZone.equals(that.timeZone) : that.timeZone != null) {
+            return false;
+        }
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = accountId != null ? accountId.hashCode() : 0;
+        result = 31 * result + (externalKey != null ? externalKey.hashCode() : 0);
+        result = 31 * result + (accountCBA != null ? accountCBA.hashCode() : 0);
+        result = 31 * result + (accountBalance != null ? accountBalance.hashCode() : 0);
+        result = 31 * result + (name != null ? name.hashCode() : 0);
+        result = 31 * result + (firstNameLength != null ? firstNameLength.hashCode() : 0);
+        result = 31 * result + (email != null ? email.hashCode() : 0);
+        result = 31 * result + (billCycleDayLocal != null ? billCycleDayLocal.hashCode() : 0);
+        result = 31 * result + (currency != null ? currency.hashCode() : 0);
+        result = 31 * result + (paymentMethodId != null ? paymentMethodId.hashCode() : 0);
+        result = 31 * result + (timeZone != null ? timeZone.hashCode() : 0);
+        result = 31 * result + (address1 != null ? address1.hashCode() : 0);
+        result = 31 * result + (address2 != null ? address2.hashCode() : 0);
+        result = 31 * result + (postalCode != null ? postalCode.hashCode() : 0);
+        result = 31 * result + (company != null ? company.hashCode() : 0);
+        result = 31 * result + (city != null ? city.hashCode() : 0);
+        result = 31 * result + (state != null ? state.hashCode() : 0);
+        result = 31 * result + (country != null ? country.hashCode() : 0);
+        result = 31 * result + (locale != null ? locale.hashCode() : 0);
+        result = 31 * result + (phone != null ? phone.hashCode() : 0);
+        result = 31 * result + (isMigrated != null ? isMigrated.hashCode() : 0);
+        result = 31 * result + (isNotifiedForInvoices != null ? isNotifiedForInvoices.hashCode() : 0);
+        return result;
+    }
 }
diff --git a/jaxrs/src/main/java/com/ning/billing/jaxrs/json/BundleJson.java b/jaxrs/src/main/java/com/ning/billing/jaxrs/json/BundleJson.java
index 5b734f5..da1a3e8 100644
--- a/jaxrs/src/main/java/com/ning/billing/jaxrs/json/BundleJson.java
+++ b/jaxrs/src/main/java/com/ning/billing/jaxrs/json/BundleJson.java
@@ -88,8 +88,9 @@ public class BundleJson extends JsonBase {
                 }
             }));
             this.subscriptions.add(new SubscriptionJson(cur,
-                                                                  events,
-                                                                  subscriptionsAuditLogs.get(cur.getId()), subscriptionEventsAuditLogs));
+                                                        events,
+                                                        (subscriptionsAuditLogs != null ? subscriptionsAuditLogs.get(cur.getId()) : null),
+                                                        subscriptionEventsAuditLogs));
         }
     }
 
diff --git a/jaxrs/src/main/java/com/ning/billing/jaxrs/json/SubscriptionJson.java b/jaxrs/src/main/java/com/ning/billing/jaxrs/json/SubscriptionJson.java
index 5a134fb..0983d64 100644
--- a/jaxrs/src/main/java/com/ning/billing/jaxrs/json/SubscriptionJson.java
+++ b/jaxrs/src/main/java/com/ning/billing/jaxrs/json/SubscriptionJson.java
@@ -332,21 +332,23 @@ public class SubscriptionJson extends JsonBase {
         this.bundleId = subscription.getBundleId().toString();
         this.subscriptionId = subscription.getId().toString();
         this.externalKey = subscription.getExternalKey();
-        this.events = new LinkedList<SubscriptionReadEventJson>();
-        for (SubscriptionEvent cur : subscriptionEvents) {
-            final BillingPeriod billingPeriod = cur.getNextBillingPeriod() != null ? cur.getNextBillingPeriod() : cur.getPrevBillingPeriod();
-            final Product product = cur.getNextProduct() != null ? cur.getNextProduct() : cur.getPrevProduct();
-            final PriceList priceList = cur.getNextPriceList() != null ? cur.getNextPriceList() : cur.getPrevPriceList();
-            final PlanPhase phase = cur.getNextPhase() != null ? cur.getNextPhase() : cur.getPrevPhase();
-            this.events.add(new SubscriptionReadEventJson(cur.getId().toString(),
-                                                          billingPeriod != null ? billingPeriod.toString() : null,
-                                                          cur.getRequestedDate(),
-                                                          cur.getEffectiveDate(),
-                                                          product != null ? product.getName() : null,
-                                                          priceList != null ? priceList.getName() : null,
-                                                          cur.getSubscriptionEventType().toString(),
-                                                          phase != null ? phase.getName() : null,
-                                                          toAuditLogJson(subscriptionEventsAuditLogs.get(cur.getId()))));
+        this.events = subscriptionEvents != null ? new LinkedList<SubscriptionReadEventJson>() : null;
+        if (events != null) {
+            for (SubscriptionEvent cur : subscriptionEvents) {
+                final BillingPeriod billingPeriod = cur.getNextBillingPeriod() != null ? cur.getNextBillingPeriod() : cur.getPrevBillingPeriod();
+                final Product product = cur.getNextProduct() != null ? cur.getNextProduct() : cur.getPrevProduct();
+                final PriceList priceList = cur.getNextPriceList() != null ? cur.getNextPriceList() : cur.getPrevPriceList();
+                final PlanPhase phase = cur.getNextPhase() != null ? cur.getNextPhase() : cur.getPrevPhase();
+                this.events.add(new SubscriptionReadEventJson(cur.getId().toString(),
+                                                              billingPeriod != null ? billingPeriod.toString() : null,
+                                                              cur.getRequestedDate(),
+                                                              cur.getEffectiveDate(),
+                                                              product != null ? product.getName() : null,
+                                                              priceList != null ? priceList.getName() : null,
+                                                              cur.getSubscriptionEventType().toString(),
+                                                              phase != null ? phase.getName() : null,
+                                                              (subscriptionEventsAuditLogs != null ? toAuditLogJson(subscriptionEventsAuditLogs.get(cur.getId())) : null)));
+            }
         }
         this.newEvents = null;
         this.deletedEvents = null;

pom.xml 2(+1 -1)

diff --git a/pom.xml b/pom.xml
index 9b9629c..bb996c6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>killbill-oss-parent</artifactId>
         <groupId>com.ning.billing</groupId>
-        <version>0.4.8-SNAPSHOT</version>
+        <version>0.4.8</version>
     </parent>
     <artifactId>killbill</artifactId>
     <version>0.6.8-SNAPSHOT</version>
diff --git a/server/src/test/java/com/ning/billing/jaxrs/TestBundle.java b/server/src/test/java/com/ning/billing/jaxrs/TestBundle.java
index 81382c0..a79ef50 100644
--- a/server/src/test/java/com/ning/billing/jaxrs/TestBundle.java
+++ b/server/src/test/java/com/ning/billing/jaxrs/TestBundle.java
@@ -138,7 +138,7 @@ public class TestBundle extends TestJaxrsBase {
 
         final AccountJson newAccount = createAccountWithDefaultPaymentMethod("dst", "dst", "dst@yahoo.com");
 
-        final BundleJson newBundleInput = new BundleJson(null, newAccount.getAccountId(), null, null, null);
+        final BundleJson newBundleInput = new BundleJson(newAccount.getAccountId(), null, null, null, null);
         final String newBundleInputJson = mapper.writeValueAsString(newBundleInput);
         uri = JaxrsResource.BUNDLES_PATH + "/" + entitlementJsonNoEvents.getBundleId();
         response = doPut(uri, newBundleInputJson, DEFAULT_EMPTY_QUERY, DEFAULT_HTTP_TIMEOUT_SEC);