ContractService extends AbstractService implements DeployComponent, ExecuteComponent, QueryComponent { public ExecutionResult tryExecute(final String encodedContractTxHash, final String functionName, final String... args) { logger.trace("Encoded tx hash: {}", encodedContractTxHash); final Pair<ContractTxHash, ContractFunction> pair = find(encodedContractTxHash, functionName); return execute(pair.v1, pair.v2, args); }  @Override Logger logger(); DeploymentResult deploy(final BuildDetails buildDetails); ExecutionResult tryExecute(final String encodedContractTxHash, final String functionName,
      final String... args); QueryResult tryQuery(final String encodedContractTxHash, final String functionName,
      final String... args); DeploymentResult getLatestContractInformation(); ContractInterface getInterface(final ContractTxHash contractTxHash);  }
@Test public void testTryExecute() { when(contractOperation.deploy(any(Account.class), any(), anyLong(), any())) .thenReturn(contractTxHash); final ContractTxHash executedContractTxHash = ContractTxHash.of(BytesValue.of(randomUUID().toString().getBytes())); when(contractOperation.execute(any(Account.class), any(), anyLong(), any())) .thenReturn(executedContractTxHash); final long nonce = Math.abs(new Random().nextLong()) + 1; final AccountState accountState = new AccountState(AccountAddressGen.generate(), nonce, Aer.ZERO); when(accountOperation.getState(account)).thenReturn(accountState); final BuildDetails buildDetails = new BuildDetails(); buildDetails.setResult(randomUUID().toString()); final DeploymentResult result = contractService.deploy(buildDetails); result.setContractInterface(contractInterface); final ExecutionResult executionResult = contractService.tryExecute(contractTxHash.toString(), contractFunction.getName()); assertNotNull(executionResult.getContractTransactionHash()); verify(contractOperation).execute(any(Account.class), any(), anyLong(), any()); }