Skip to content

Commit

Permalink
Replace mock arg with SEPA PaymentMethod instance
Browse files Browse the repository at this point in the history
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 bisq-network#4158
  • Loading branch information
ghubstan committed Apr 11, 2020
1 parent edc4df1 commit fc458e7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<TraderDataItem> items = service.getTraderPaymentAccounts(now, PaymentMethod.SEPA, disputes);
assertEquals(items.size(), 2);
List<TraderDataItem> items = service.getTraderPaymentAccounts(now, getPaymentMethodById(PaymentMethod.SEPA_ID), disputes);
assertEquals(2, items.size());

// Setup a mocked arbitrator key
ECKey arbitratorKey = mock(ECKey.class);
Expand Down

0 comments on commit fc458e7

Please sign in to comment.