AccountTemplate extends AbstractTemplate implements AccountOperation { @Override public List<ElectedCandidate> listElected(final String voteId, final int showCount) { return request(accountMethods.getListElected(), Arrays.<Object>asList(voteId, showCount)); } AccountTemplate(final ContextStorage<Context> contextStorage); @Override AccountState getState(final Account account); @Override AccountState getState(final AccountAddress address); @Override TxHash createName(final Account account, final String name, final long nonce); @Override TxHash createName(final Signer signer, final String name, final long nonce); @Override TxHash createNameTx(final Signer signer, final Name name, final long nonce); @Override TxHash updateName(final Account owner, final String name, final AccountAddress newOwner,
      final long nonce); @Override TxHash updateName(final Signer signer, final String name, final AccountAddress newOwner,
      final long nonce); @Override TxHash updateNameTx(final Signer signer, final Name name, final AccountAddress newOwner,
      final long nonce); @Override AccountAddress getNameOwner(final String name); @Override AccountAddress getNameOwner(final Name name); @Override AccountAddress getNameOwner(final String name, final long blockNumber); @Override AccountAddress getNameOwner(final Name name, long blockNumber); @Override TxHash stake(final Account account, final Aer amount, final long nonce); @Override TxHash stake(final Signer signer, final Aer amount, final long nonce); @Override TxHash stakeTx(final Signer signer, final Aer amount, final long nonce); @Override TxHash unstake(final Account account, final Aer amount, final long nonce); @Override TxHash unstake(final Signer signer, final Aer amount, final long nonce); @Override TxHash unstakeTx(final Signer signer, final Aer amount, final long nonce); @Override StakeInfo getStakingInfo(final AccountAddress accountAddress); @Override StakeInfo getStakeInfo(AccountAddress accountAddress); @Override TxHash vote(final Signer signer, final String voteId, final List<String> candidates,
      final long nonce); @Override TxHash voteTx(final Signer signer, final String voteId, final List<String> candidates,
      final long nonce); @Override AccountTotalVote getVotesOf(final AccountAddress accountAddress); @Override List<ElectedCandidate> listElected(final String voteId, final int showCount); @Override Transaction sign(final Account account, final RawTransaction rawTransaction); @Override boolean verify(final Account account, final Transaction transaction);  }
@Test public void testListElected() throws Exception { final AccountTemplate accountTemplate = new AccountTemplate(contextStorage); final Requester mockRequester = mock(Requester.class); final List<ElectedCandidate> expected = emptyList(); when(mockRequester.request(ArgumentMatchers.<Invocation<?>>any())) .thenReturn(expected); accountTemplate.requester = mockRequester; final List<ElectedCandidate> actual = accountTemplate.listElected(anyVoteId, 20); assertEquals(expected, actual); }