KeyStoreTemplate extends AbstractTemplate implements KeyStoreOperation { @Override public EncryptedPrivateKey exportKey(final Authentication authentication) { return request(keyStoreMethods.getExportKey(), Arrays.<Object>asList(authentication)); } 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 testExportKey() throws Exception { final KeyStoreTemplate keystoreTemplate = new KeyStoreTemplate(contextStorage); final Requester mockRequester = mock(Requester.class); final EncryptedPrivateKey expected = EncryptedPrivateKey.EMPTY; when(mockRequester.request(ArgumentMatchers.<Invocation<?>>any())) .thenReturn(expected); keystoreTemplate.requester = mockRequester; final EncryptedPrivateKey actual = keystoreTemplate.exportKey(anyAuthentication); assertEquals(expected, actual); }