protected Request buildRequest(String url, String sender, String data)
            throws JsonProcessingException {
        if (sender == null || !WalletUtils.isValidAddress(sender)) {
            throw new EnsResolutionException("Sender address is null or not valid");
        }
        if (data == null) {
            throw new EnsResolutionException("Data is null");
        }
        if (!url.contains("{sender}")) {
            throw new EnsResolutionException("Url is not valid, sender parameter is not exist");
        }

        // URL expansion
        String href = url.replace("{sender}", sender).replace("{data}", data);

        Request.Builder builder = new Request.Builder().url(href);

        if (url.contains("{data}")) {
            return builder.get().build();
        } else {
            EnsGatewayRequestDTO requestDTO = new EnsGatewayRequestDTO(data);
            ObjectMapper om = ObjectMapperFactory.getObjectMapper();

            return builder.post(RequestBody.create(om.writeValueAsString(requestDTO), JSON))
                    .addHeader("Content-Type", "application/json")
                    .build();
        }
    }
@Test
    void buildRequestWhenWithoutDataTest() throws IOException {
        String url = "https://example.com/gateway/{sender}.json";
        String sender = "0x226159d592E2b063810a10Ebf6dcbADA94Ed68b8";

        assertThrows(
                EnsResolutionException.class, () -> ensResolver.buildRequest(url, sender, null));
    }