@Test
public void testTryQuery() {

  when(contractOperation.deploy(any(Account.class), any(), anyLong(), any()))
      .thenReturn(contractTxHash);
  final ContractResult contractResult = mock(ContractResult.class);
  when(contractResult.getResultInRawBytes())
      .thenReturn(BytesValue.of(randomUUID().toString().getBytes()));
  when(contractOperation.query(any())).thenReturn(contractResult);
  // When
  final BuildDetails buildDetails = new BuildDetails();
  buildDetails.setResult(randomUUID().toString());
  final DeploymentResult result = contractService.deploy(buildDetails);
  result.setContractInterface(contractInterface);
  final QueryResult queryResult =
      contractService.tryQuery(contractTxHash.toString(), contractFunction.getName());
  // Then
  assertNotNull(queryResult.getResult());
}