diff --git a/invoice/src/main/java/com/ning/billing/invoice/InvoiceDispatcher.java b/invoice/src/main/java/com/ning/billing/invoice/InvoiceDispatcher.java
index 2dd89c2..b50f260 100644
--- a/invoice/src/main/java/com/ning/billing/invoice/InvoiceDispatcher.java
+++ b/invoice/src/main/java/com/ning/billing/invoice/InvoiceDispatcher.java
@@ -35,7 +35,6 @@ import com.ning.billing.account.api.AccountApiException;
import com.ning.billing.account.api.AccountUserApi;
import com.ning.billing.account.api.BillCycleDay;
import com.ning.billing.catalog.api.Currency;
-import com.ning.billing.entitlement.api.billing.BillingEvent;
import com.ning.billing.entitlement.api.billing.EntitlementBillingApiException;
import com.ning.billing.entitlement.api.user.EffectiveSubscriptionEvent;
import com.ning.billing.invoice.api.Invoice;
@@ -192,7 +191,7 @@ public class InvoiceDispatcher {
}
}
- if (account.isNotifiedForInvoices() && invoice != null) {
+ if (account.isNotifiedForInvoices() && invoice != null && !dryRun) {
// Need to re-hydrate the invoice object to get the invoice number (record id)
invoiceNotifier.notify(account, invoiceDao.getById(invoice.getId()));
}
diff --git a/server/src/test/java/com/ning/billing/jaxrs/TestPayment.java b/server/src/test/java/com/ning/billing/jaxrs/TestPayment.java
index 2c2942e..aeedfc5 100644
--- a/server/src/test/java/com/ning/billing/jaxrs/TestPayment.java
+++ b/server/src/test/java/com/ning/billing/jaxrs/TestPayment.java
@@ -194,8 +194,8 @@ public class TestPayment extends TestJaxrsBase {
// Verify the refund via the payment API
final PaymentJsonWithBundleKeys retrievedPaymentJsonWithBundleKeys = getPaymentWithRefundsAndChargebacks(paymentJsonSimple.getPaymentId());
Assert.assertEquals(retrievedPaymentJsonWithBundleKeys.getPaymentId(), paymentJsonSimple.getPaymentId());
- Assert.assertEquals(retrievedPaymentJsonWithBundleKeys.getPaidAmount(), paymentJsonSimple.getPaidAmount().add(refundAmount.negate()).setScale(2, RoundingMode.HALF_UP));
- Assert.assertEquals(retrievedPaymentJsonWithBundleKeys.getAmount(), paymentJsonSimple.getAmount());
+ Assert.assertEquals(retrievedPaymentJsonWithBundleKeys.getPaidAmount().setScale(2, RoundingMode.HALF_UP), paymentJsonSimple.getPaidAmount().add(refundAmount.negate()).setScale(2, RoundingMode.HALF_UP));
+ Assert.assertEquals(retrievedPaymentJsonWithBundleKeys.getAmount().setScale(2, RoundingMode.HALF_UP), paymentJsonSimple.getAmount().setScale(2, RoundingMode.HALF_UP));
Assert.assertEquals(retrievedPaymentJsonWithBundleKeys.getAccountId(), paymentJsonSimple.getAccountId());
Assert.assertEquals(retrievedPaymentJsonWithBundleKeys.getInvoiceId(), paymentJsonSimple.getInvoiceId());
Assert.assertEquals(retrievedPaymentJsonWithBundleKeys.getRequestedDate(), paymentJsonSimple.getRequestedDate());