public <T> HttpResponse<T> httpRequest(String url, String method, HttpHeaders headers, Object requestBodyData,
                                                  TypeReference<T> responseFormat) {
        return httpRequest(url, method, headers, requestBodyData, responseFormat, null, null);
    }
@Test
    public void testUseSslConfigsOnlyWhenNecessary() throws Exception {
        int statusCode = Response.Status.OK.getStatusCode();
        Request req = mock(Request.class);
        ContentResponse resp = mock(ContentResponse.class);
        when(resp.getContentAsString()).thenReturn(toJsonString(TEST_DTO));
        setupHttpClient(statusCode, req, resp);
        assertDoesNotThrow(() -> httpRequest(
                httpClient, MOCK_URL, TEST_METHOD, TEST_TYPE, TEST_SIGNATURE_ALGORITHM
        ));
        String httpsUrl = "https://localhost:1234/api/endpoint";
        RestClient client = spy(new RestClient(null));
        assertThrows(RuntimeException.class, () -> client.httpRequest(
                httpsUrl,
                TEST_METHOD,
                null,
                TEST_DTO,
                TEST_TYPE,
                MOCK_SECRET_KEY,
                TEST_SIGNATURE_ALGORITHM
        ));
    }