Details
diff --git a/entitlement/src/test/java/com/ning/billing/entitlement/api/timeline/TestRepairBP.java b/entitlement/src/test/java/com/ning/billing/entitlement/api/timeline/TestRepairBP.java
index af685e4..6be5022 100644
--- a/entitlement/src/test/java/com/ning/billing/entitlement/api/timeline/TestRepairBP.java
+++ b/entitlement/src/test/java/com/ning/billing/entitlement/api/timeline/TestRepairBP.java
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright 2010-2011 Ning, Inc.
*
* Ning licenses this file to you under the Apache License, version 2.0
@@ -621,7 +621,7 @@ public class TestRepairBP extends TestApiBaseRepair {
// SET CTD to BASE SUBSCRIPTION SP CANCEL OCCURS EOT
final DateTime newChargedThroughDate = baseSubscription.getStartDate().plusDays(30).plusMonths(1);
billingApi.setChargedThroughDate(baseSubscription.getId(), newChargedThroughDate, context);
- baseSubscription = (SubscriptionData) entitlementApi.getSubscriptionFromId(baseSubscription.getId());
+ baseSubscription = entitlementApi.getSubscriptionFromId(baseSubscription.getId());
final DateTime requestedChange = clock.getUTCNow();
@@ -656,7 +656,7 @@ public class TestRepairBP extends TestApiBaseRepair {
repairApi.repairBundle(bRepair, dryRun, context);
assertTrue(testListener.isCompleted(5000));
- baseSubscription = (SubscriptionData) entitlementApi.getSubscriptionFromId(baseSubscription.getId());
+ baseSubscription = entitlementApi.getSubscriptionFromId(baseSubscription.getId());
assertEquals(((SubscriptionData) baseSubscription).getActiveVersion(), SubscriptionEvents.INITIAL_VERSION + 1);
assertEquals(baseSubscription.getBundleId(), bundle.getId());
@@ -713,7 +713,7 @@ public class TestRepairBP extends TestApiBaseRepair {
}, ErrorCode.ENT_REPAIR_VIEW_CHANGED);
}
- @Test(groups = {"slow"}, enabled = false)
+ @Test(groups = "slow")
public void testENT_REPAIR_VIEW_CHANGED_ctd() throws Exception {
log.info("Starting testENT_REPAIR_VIEW_CHANGED_ctd");
diff --git a/entitlement/src/test/java/com/ning/billing/entitlement/api/user/TestUserApiCreateSql.java b/entitlement/src/test/java/com/ning/billing/entitlement/api/user/TestUserApiCreateSql.java
index 135e98c..ca3bc10 100644
--- a/entitlement/src/test/java/com/ning/billing/entitlement/api/user/TestUserApiCreateSql.java
+++ b/entitlement/src/test/java/com/ning/billing/entitlement/api/user/TestUserApiCreateSql.java
@@ -55,7 +55,7 @@ public class TestUserApiCreateSql extends TestUserApiCreate {
}
@Override
- @Test(enabled = false, groups = {"slow"})
+ @Test(groups = {"slow"})
protected void testSubscriptionWithAddOn() {
super.testSubscriptionWithAddOn();
}
diff --git a/entitlement/src/test/java/com/ning/billing/entitlement/api/user/TestUserApiRecreateMemory.java b/entitlement/src/test/java/com/ning/billing/entitlement/api/user/TestUserApiRecreateMemory.java
index b164d65..3640b28 100644
--- a/entitlement/src/test/java/com/ning/billing/entitlement/api/user/TestUserApiRecreateMemory.java
+++ b/entitlement/src/test/java/com/ning/billing/entitlement/api/user/TestUserApiRecreateMemory.java
@@ -32,13 +32,13 @@ public class TestUserApiRecreateMemory extends TestUserApiRecreate {
}
@Override
- @Test(enabled = false, groups = {"fast"})
+ @Test(groups = "fast")
protected void testRecreateWithBPCanceledThroughSubscription() {
super.testRecreateWithBPCanceledThroughSubscription();
}
@Override
- @Test(enabled = false, groups = {"fast"})
+ @Test(groups = "fast")
protected void testCreateWithBPCanceledFromUserApi() {
super.testRecreateWithBPCanceledThroughSubscription();
}
diff --git a/junction/src/main/java/com/ning/billing/junction/plumbing/billing/BillCycleDayCalculator.java b/junction/src/main/java/com/ning/billing/junction/plumbing/billing/BillCycleDayCalculator.java
index f76c04e..2b75d2c 100644
--- a/junction/src/main/java/com/ning/billing/junction/plumbing/billing/BillCycleDayCalculator.java
+++ b/junction/src/main/java/com/ning/billing/junction/plumbing/billing/BillCycleDayCalculator.java
@@ -102,7 +102,14 @@ public class BillCycleDayCalculator {
private int calculateBcdFromSubscription(final Subscription subscription, final Plan plan, final Account account) throws AccountApiException {
final DateTime date = plan.dateOfFirstRecurringNonZeroCharge(subscription.getStartDate());
- return date.toDateTime(account.getTimeZone()).getDayOfMonth();
+ // There are really two kind of billCycleDay:
+ // - a System billingCycleDay which should be computed from UTC time (in order to get the correct notification time at
+ // the end of each service period
+ // - a User billingCycleDay which should align with the account timezone
+ //
+ // TODO At this point we only compute the system one; should we need two filds in the account table
+ //return date.toDateTime(account.getTimeZone()).getDayOfMonth();
+ return date.getDayOfMonth();
}
}