mirror of
https://github.com/bisq-network/bisq.git
synced 2025-03-03 10:46:54 +01:00
Add get default payment acct helper
This commit is contained in:
parent
e63a6c5771
commit
92f36ed03a
1 changed files with 21 additions and 0 deletions
|
@ -20,16 +20,25 @@ package bisq.apitest.method;
|
|||
import bisq.proto.grpc.CreatePaymentAccountRequest;
|
||||
import bisq.proto.grpc.GetBalanceRequest;
|
||||
import bisq.proto.grpc.GetFundingAddressesRequest;
|
||||
import bisq.proto.grpc.GetPaymentAccountsRequest;
|
||||
import bisq.proto.grpc.LockWalletRequest;
|
||||
import bisq.proto.grpc.RegisterDisputeAgentRequest;
|
||||
import bisq.proto.grpc.RemoveWalletPasswordRequest;
|
||||
import bisq.proto.grpc.SetWalletPasswordRequest;
|
||||
import bisq.proto.grpc.UnlockWalletRequest;
|
||||
|
||||
import protobuf.PaymentAccount;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
|
||||
import static bisq.common.app.DevEnv.DEV_PRIVILEGE_PRIV_KEY;
|
||||
import static bisq.core.payment.payload.PaymentMethod.PERFECT_MONEY;
|
||||
import static bisq.core.support.dispute.agent.DisputeAgent.DisputeAgentType.MEDIATOR;
|
||||
import static bisq.core.support.dispute.agent.DisputeAgent.DisputeAgentType.REFUNDAGENT;
|
||||
import static java.util.Comparator.comparing;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
|
||||
|
||||
|
@ -107,6 +116,18 @@ public class MethodTest extends ApiTestCase {
|
|||
.build();
|
||||
}
|
||||
|
||||
protected final PaymentAccount getDefaultPerfectDummyPaymentAccount(BisqAppConfig bisqAppConfig) {
|
||||
var getPaymentAccountsRequest = GetPaymentAccountsRequest.newBuilder().build();
|
||||
var paymentAccountsService = grpcStubs(bisqAppConfig).paymentAccountsService;
|
||||
PaymentAccount paymentAccount = paymentAccountsService.getPaymentAccounts(getPaymentAccountsRequest)
|
||||
.getPaymentAccountsList()
|
||||
.stream()
|
||||
.sorted(comparing(protobuf.PaymentAccount::getCreationDate))
|
||||
.collect(Collectors.toList()).get(0);
|
||||
assertEquals("PerfectMoney dummy", paymentAccount.getAccountName());
|
||||
return paymentAccount;
|
||||
}
|
||||
|
||||
// Static conveniences for test methods and test case fixture setups.
|
||||
|
||||
protected static RegisterDisputeAgentRequest createRegisterDisputeAgentRequest(String disputeAgentType) {
|
||||
|
|
Loading…
Add table
Reference in a new issue