@Test public void testVote() { final AccountOperation mockOperation = mock(AccountOperation.class); when(mockOperation .voteTx(any(Signer.class), anyString(), ArgumentMatchers.<String>anyList(), anyLong())) .thenReturn(TxHash.of(BytesValue.EMPTY)); final AergoClient mockClient = mock(AergoClient.class); when(mockClient.getAccountOperation()).thenReturn(mockOperation); final ClientProvider mockClientProvider = mock(ClientProvider.class); when(mockClientProvider.getClient()).thenReturn(mockClient); final AergoKey signer = new AergoKeyGenerator().create(); final TransactionApi transactionApi = new TransactionApiImpl(mockClientProvider, signer, txRequester); final TxHash txHash = transactionApi.vote(anyVoteId, anyCandidates); assertNotNull(txHash); }
@Override public TxHash vote(final String voteId, final List<String> candidates) { try { return txRequester.request(getClient(), getSigner(), new TxRequestFunction() { @Override public TxHash apply(Signer signer, Long t) { return getClient().getAccountOperation().voteTx(signer, voteId, candidates, t); } }); } catch (Exception e) { throw converter.convert(e); } }
TransactionApiImpl extends AbstractApi implements TransactionApi { @Override public TxHash vote(final String voteId, final List<String> candidates) { try { return txRequester.request(getClient(), getSigner(), new TxRequestFunction() { @Override public TxHash apply(Signer signer, Long t) { return getClient().getAccountOperation().voteTx(signer, voteId, candidates, t); } }); } catch (Exception e) { throw converter.convert(e); } } }
TransactionApiImpl extends AbstractApi implements TransactionApi { @Override public TxHash vote(final String voteId, final List<String> candidates) { try { return txRequester.request(getClient(), getSigner(), new TxRequestFunction() { @Override public TxHash apply(Signer signer, Long t) { return getClient().getAccountOperation().voteTx(signer, voteId, candidates, t); } }); } catch (Exception e) { throw converter.convert(e); } }  }
TransactionApiImpl extends AbstractApi implements TransactionApi { @Override public TxHash vote(final String voteId, final List<String> candidates) { try { return txRequester.request(getClient(), getSigner(), new TxRequestFunction() { @Override public TxHash apply(Signer signer, Long t) { return getClient().getAccountOperation().voteTx(signer, voteId, candidates, t); } }); } catch (Exception e) { throw converter.convert(e); } }  @Override TxHash createName(final String name); @Override TxHash createName(final Name name); @Override TxHash updateName(final String name, final AccountAddress newOwner); @Override TxHash updateName(final Name name, final AccountAddress newOwner); @Override TxHash stake(final Aer amount); @Override TxHash unstake(final Aer amount); @Override TxHash voteBp(List<String> candidates); @Override TxHash vote(final String voteId, final List<String> candidates); @Override TxHash send(AccountAddress recipient, Aer amount, Fee fee); @Override TxHash send(final AccountAddress recipient, final Aer amount, final Fee fee,
      final BytesValue payload); @Override TxHash send(final String recipient, final Aer amount, final Fee fee); @Override TxHash send(final String recipient, final Aer amount, final Fee fee,
      final BytesValue payload); @Override TxHash send(final Name recipient, final Aer amount, final Fee fee); @Override TxHash send(final Name recipient, final Aer amount, final Fee fee,
      final BytesValue payload); @Override TxHash commit(final RawTransaction rawTransaction); @Override TxHash commit(final Transaction signedTransaction); @Override TxHash deploy(final ContractDefinition contractDefinition, final Fee fee); @Override TxHash redeploy(final ContractAddress existingContract,
      final ContractDefinition contractDefinition, final Fee fee); @Override TxHash execute(final ContractInvocation contractInvocation, final Fee fee); }
TransactionApiImpl extends AbstractApi implements TransactionApi { @Override public TxHash vote(final String voteId, final List<String> candidates) { try { return txRequester.request(getClient(), getSigner(), new TxRequestFunction() { @Override public TxHash apply(Signer signer, Long t) { return getClient().getAccountOperation().voteTx(signer, voteId, candidates, t); } }); } catch (Exception e) { throw converter.convert(e); } }  @Override TxHash createName(final String name); @Override TxHash createName(final Name name); @Override TxHash updateName(final String name, final AccountAddress newOwner); @Override TxHash updateName(final Name name, final AccountAddress newOwner); @Override TxHash stake(final Aer amount); @Override TxHash unstake(final Aer amount); @Override TxHash voteBp(List<String> candidates); @Override TxHash vote(final String voteId, final List<String> candidates); @Override TxHash send(AccountAddress recipient, Aer amount, Fee fee); @Override TxHash send(final AccountAddress recipient, final Aer amount, final Fee fee,
      final BytesValue payload); @Override TxHash send(final String recipient, final Aer amount, final Fee fee); @Override TxHash send(final String recipient, final Aer amount, final Fee fee,
      final BytesValue payload); @Override TxHash send(final Name recipient, final Aer amount, final Fee fee); @Override TxHash send(final Name recipient, final Aer amount, final Fee fee,
      final BytesValue payload); @Override TxHash commit(final RawTransaction rawTransaction); @Override TxHash commit(final Transaction signedTransaction); @Override TxHash deploy(final ContractDefinition contractDefinition, final Fee fee); @Override TxHash redeploy(final ContractAddress existingContract,
      final ContractDefinition contractDefinition, final Fee fee); @Override TxHash execute(final ContractInvocation contractInvocation, final Fee fee);  }