### Question:
Web3jService implements BlockchainService { @Override public String getRevertReason(String from, String to, BigInteger blockNumber, String input) { try { return web3j.ethCall( Transaction.createEthCallTransaction(from, to, input), DefaultBlockParameter.valueOf(blockNumber) ).send().getRevertReason(); } catch (IOException e) { throw new BlockchainException("Error getting the revert reason", e); } } Web3jService(String nodeName,
                        Web3j web3j,
                        ContractEventDetailsFactory eventDetailsFactory,
                        AsyncTaskService asyncTaskService); @Override List<ContractEventDetails> retrieveEvents(ContractEventFilter eventFilter,
                                                     BigInteger startBlock,
                                                     BigInteger endBlock); @Override FilterSubscription registerEventListener(ContractEventFilter eventFilter,
                                                    ContractEventListener eventListener,
                                                    BigInteger startBlock,
                                                    BigInteger endBlock,
                                                    Optional<Runnable> onCompletion); @Override String getClientVersion(); @Override TransactionReceipt getTransactionReceipt(String txId); @Override BigInteger getCurrentBlockNumber(); Optional<Block> getBlock(String blockHash, boolean fullTransactionObjects); List<ContractEventDetails> getEventsForFilter(ContractEventFilter filter, BigInteger blockNumber); @Override String getRevertReason(String from, String to, BigInteger blockNumber, String input);  }### Answer:
@Test public void testGetRevertReason() throws IOException { final Request<?, EthCall> mockRequest = mock(Request.class); final EthCall ethCall = mock(EthCall.class); when(ethCall.getRevertReason()).thenReturn(REVERT_REASON); when(mockRequest.send()).thenReturn(ethCall); doReturn(mockRequest).when(mockWeb3j).ethCall(any(Transaction.class), any(DefaultBlockParameter.class)); assertEquals(REVERT_REASON, underTest.getRevertReason(FROM_ADDRESS, TO_ADDRESS, BLOCK_NUMBER, "0x1")); }