### Question:
ContractTemplate extends AbstractTemplate implements ContractOperation { @Override public TxHash deployTx(final Signer signer, final ContractDefinition contractDefinition, final long nonce, final Fee fee) { return request(contractMethods.getDeployTx(), Arrays.<Object>asList(signer, contractDefinition, nonce, fee)); } ContractTemplate(final ContextStorage<Context> contextStorage); @Override ContractTxReceipt getReceipt(final ContractTxHash contractTxHash); @Override ContractTxReceipt getContractTxReceipt(final TxHash txHash); @Override ContractTxHash deploy(final Account creator, final ContractDefinition contractDefinition,
      final long nonce); @Override ContractTxHash deploy(final Account creator, final ContractDefinition contractDefinition,
      final long nonce, final Fee fee); @Override ContractTxHash deploy(final Signer signer, final ContractDefinition contractDefinition,
      final long nonce, final Fee fee); @Override TxHash deployTx(final Signer signer, final ContractDefinition contractDefinition,
      final long nonce, final Fee fee); @Override ContractTxHash redeploy(final Signer signer, final ContractAddress existingContract,
      final ContractDefinition contractDefinition, final long nonce, final Fee fee); @Override TxHash redeployTx(final Signer signer, final ContractAddress existingContract,
      final ContractDefinition contractDefinition, final long nonce, final Fee fee); @Override ContractInterface getContractInterface(final ContractAddress contractAddress); @Override ContractTxHash execute(final Account executor, final ContractInvocation contractInvocation,
      final long nonce); @Override ContractTxHash execute(final Account executor, final ContractInvocation contractInvocation,
      final long nonce, final Fee fee); @Override ContractTxHash execute(final Signer signer, final ContractInvocation contractInvocation,
      final long nonce, final Fee fee); @Override TxHash executeTx(final Signer signer, final ContractInvocation contractInvocation,
      final long nonce, final Fee fee); @Override ContractResult query(final ContractInvocation contractInvocation); @Override List<Event> listEvents(final EventFilter filter); @Override Subscription<Event> subscribeEvent(final EventFilter filter,
      final StreamObserver<Event> observer);  }### Answer:
@Test public void testDeployTx() throws Exception { final ContractTemplate contractTemplate = new ContractTemplate(contextStorage); final Requester mockRequester = mock(Requester.class); final ContractTxHash expected = ContractTxHash.of(BytesValue.EMPTY); when(mockRequester.request(ArgumentMatchers.<Invocation<?>>any())) .thenReturn(expected); contractTemplate.requester = mockRequester; final Account deprecatedOne = new AccountFactory().create(new AergoKeyGenerator().create()); assertEquals(expected, contractTemplate.deploy(deprecatedOne, anyDefinition, anyNonce)); assertEquals(expected, contractTemplate.deploy(deprecatedOne, anyDefinition, anyNonce, anyFee)); assertEquals(expected, contractTemplate.deploy(anySigner, anyDefinition, anyNonce, anyFee)); assertEquals(expected, contractTemplate.deployTx(anySigner, anyDefinition, anyNonce, anyFee)); }