KeyStoreTemplate extends AbstractTemplate implements KeyStoreOperation { @Override public TxHash send(final AccountAddress sender, final AccountAddress recipient, final Aer amount, final BytesValue payload) { return request(keyStoreMethods.getSend(), Arrays.asList(sender, recipient, amount, payload)); } KeyStoreTemplate(final ContextStorage<Context> contextStorage); @Override List<AccountAddress> list(); @Override AccountAddress create(final String password); @Override boolean lock(final Authentication authentication); @Override boolean unlock(final Authentication authentication); @Override Transaction sign(final RawTransaction rawTransaction); @Override AccountAddress importKey(final EncryptedPrivateKey encryptedKey, final String oldPassword,
      final String newPassword); @Override EncryptedPrivateKey exportKey(final Authentication authentication); @Override TxHash send(final AccountAddress sender, final AccountAddress recipient, final Aer amount,
      final BytesValue payload);  }
@Test public void testSend() throws Exception { final KeyStoreTemplate keystoreTemplate = new KeyStoreTemplate(contextStorage); final Requester mockRequester = mock(Requester.class); final TxHash expected = TxHash.of(BytesValue.EMPTY); when(mockRequester.request(ArgumentMatchers.<Invocation<?>>any())) .thenReturn(expected); keystoreTemplate.requester = mockRequester; final TxHash actual = keystoreTemplate .send(anyAccountAddress, anyAccountAddress, anyAmount, BytesValue.EMPTY); assertEquals(expected, actual); }