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 a81d71b..de7a40d 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
@@ -585,7 +585,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();
baseSubscription.changePlan("Pistol", BillingPeriod.MONTHLY, PriceListSet.DEFAULT_PRICELIST_NAME, requestedChange, context);
@@ -617,7 +617,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());
@@ -670,7 +670,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 {
final TestWithException test = new TestWithException();
final DateTime startDate = clock.getUTCNow();
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 526d3b2..64c436a 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
@@ -54,7 +54,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 fa808b6..e033b2e 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
@@ -30,13 +30,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 67c4b66..ce98f24 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();
}
}