From fc458e7a7d4d96711addfc76d73e1b3583e34ef1 Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Sat, 11 Apr 2020 14:02:22 -0300 Subject: [PATCH] Replace mock arg with SEPA PaymentMethod instance Test AccountAgeWitnessServiceTest > testArbitratorSignWitness failed in full gradle build, but passed when run as a single test: ./gradlew :core:cleanTest :core:test \ --tests "bisq.core.account.witness.AccountAgeWitnessServiceTest" This test also passed when run in the IDE. Solved by not passing a mocked PaymentMethod.SEPA argument into the test's service.getTraderPaymentAccounts() method, where mock paymentId field was null when running full build's test suites. Fix for #4158 --- .../core/account/witness/AccountAgeWitnessServiceTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/bisq/core/account/witness/AccountAgeWitnessServiceTest.java b/core/src/test/java/bisq/core/account/witness/AccountAgeWitnessServiceTest.java index e3adb90fe9c..e0baf486644 100644 --- a/core/src/test/java/bisq/core/account/witness/AccountAgeWitnessServiceTest.java +++ b/core/src/test/java/bisq/core/account/witness/AccountAgeWitnessServiceTest.java @@ -62,6 +62,7 @@ import org.junit.Ignore; import org.junit.Test; +import static bisq.core.payment.payload.PaymentMethod.getPaymentMethodById; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -216,8 +217,8 @@ public void testArbitratorSignWitness() throws IOException { when(contract.getBuyerPaymentAccountPayload()).thenReturn(buyerPaymentAccountPayload); when(contract.getSellerPaymentAccountPayload()).thenReturn(sellerPaymentAccountPayload); when(contract.getOfferPayload()).thenReturn(mock(OfferPayload.class)); - List items = service.getTraderPaymentAccounts(now, PaymentMethod.SEPA, disputes); - assertEquals(items.size(), 2); + List items = service.getTraderPaymentAccounts(now, getPaymentMethodById(PaymentMethod.SEPA_ID), disputes); + assertEquals(2, items.size()); // Setup a mocked arbitrator key ECKey arbitratorKey = mock(ECKey.class);