diff --git a/payment/src/test/java/com/ning/billing/payment/core/TestPaymentMethodProcessorRefreshWithDB.java b/payment/src/test/java/com/ning/billing/payment/core/TestPaymentMethodProcessorRefreshWithDB.java
index d0967a1..8d4f602 100644
--- a/payment/src/test/java/com/ning/billing/payment/core/TestPaymentMethodProcessorRefreshWithDB.java
+++ b/payment/src/test/java/com/ning/billing/payment/core/TestPaymentMethodProcessorRefreshWithDB.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.UUID;
import org.testng.Assert;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import com.ning.billing.account.api.Account;
@@ -32,6 +33,13 @@ import com.ning.billing.payment.provider.DefaultNoOpPaymentMethodPlugin;
public class TestPaymentMethodProcessorRefreshWithDB extends PaymentTestSuiteWithEmbeddedDB {
+
+ @BeforeMethod(groups = "slow")
+ public void beforeMethod() throws Exception {
+ super.beforeMethod();
+ getPluginApi().resetPaymentMethods(null);
+ }
+
@Test(groups = "slow")
public void testRefreshWithNewPaymentMethod() throws Exception {
@@ -54,7 +62,7 @@ public class TestPaymentMethodProcessorRefreshWithDB extends PaymentTestSuiteWit
@Test(groups = "slow")
public void testRefreshWithDeletedPaymentMethod() throws Exception {
- final Account account = testHelper.createTestAccount("foo@bar.com", true);
+ final Account account = testHelper.createTestAccount("super@bar.com", true);
Assert.assertEquals(getPluginApi().getPaymentMethods(account.getId(), true, callContext).size(), 1);
final UUID firstPmId = account.getPaymentMethodId();
diff --git a/payment/src/test/java/com/ning/billing/payment/provider/MockPaymentProviderPlugin.java b/payment/src/test/java/com/ning/billing/payment/provider/MockPaymentProviderPlugin.java
index 6fc0f11..a9b754f 100644
--- a/payment/src/test/java/com/ning/billing/payment/provider/MockPaymentProviderPlugin.java
+++ b/payment/src/test/java/com/ning/billing/payment/provider/MockPaymentProviderPlugin.java
@@ -138,8 +138,13 @@ public class MockPaymentProviderPlugin implements NoOpPaymentPluginApi {
}
@Override
- public void resetPaymentMethods(final List<PaymentMethodInfoPlugin> paymentMethods) {
+ public void resetPaymentMethods(final List<PaymentMethodInfoPlugin> input) {
paymentMethods.clear();
+ if (input != null) {
+ for (PaymentMethodInfoPlugin cur : input) {
+ paymentMethods.put(cur.getPaymentMethodId().toString(), cur);
+ }
+ }
}
@Override