TransactionApiImpl extends AbstractApi implements TransactionApi { @Override public TxHash redeploy(final ContractAddress existingContract, final ContractDefinition contractDefinition, final Fee fee) { try { return txRequester.request(getClient(), getSigner(), new TxRequestFunction() { @Override public TxHash apply(Signer signer, Long t) { return getClient().getContractOperation() .redeployTx(signer, existingContract, contractDefinition, t, fee); } }); } 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);  }
@Test public void testRedeploy() { final ContractOperation mockOperation = mock(ContractOperation.class); when(mockOperation .redeployTx(any(Signer.class), any(ContractAddress.class), any(ContractDefinition.class), anyLong(), any(Fee.class))) .thenReturn(TxHash.of(BytesValue.EMPTY)); final AergoClient mockClient = mock(AergoClient.class); when(mockClient.getContractOperation()).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 contractTxHash = transactionApi .redeploy(anyContractAddress, anyDefinition, anyFee); assertNotNull(contractTxHash); }