@InvokeOnHeader(Web3jConstants.ETH_ESTIMATE_GAS)
    void ethEstimateGas(Message message) throws IOException {
        String fromAddress = message.getHeader(Web3jConstants.FROM_ADDRESS, configuration::getFromAddress, String.class);
        String toAddress = message.getHeader(Web3jConstants.TO_ADDRESS, configuration::getToAddress, String.class);
        String data = message.getHeader(Web3jConstants.DATA, configuration::getData, String.class);

        org.web3j.protocol.core.methods.request.Transaction transaction
                = new org.web3j.protocol.core.methods.request.Transaction(
                        fromAddress, null, null, null, toAddress, null, data);

        Request<?, EthEstimateGas> request = web3j.ethEstimateGas(transaction);
        setRequestId(message, request);
        EthEstimateGas response = request.send();
        boolean hasError = checkForError(message, response);
        if (!hasError) {
            message.setBody(response.getAmountUsed());
        }
    }
@Test
    public void ethEstimateGasTest() throws Exception {
        EthEstimateGas response = Mockito.mock(EthEstimateGas.class);
        Mockito.when(mockWeb3j.ethEstimateGas(any())).thenReturn(request);
        Mockito.when(request.send()).thenReturn(response);
        Mockito.when(response.getAmountUsed()).thenReturn(BigInteger.ONE);

        Exchange exchange = createExchangeWithBodyAndHeader(null, OPERATION, Web3jConstants.ETH_ESTIMATE_GAS);
        template.send(exchange);
        BigInteger body = exchange.getIn().getBody(BigInteger.class);
        assertEquals(BigInteger.ONE, body);
    }