assertTrue(SocketDestHelper.isSocketRestrictionFlagActive());
RestTemplate restTemplate = new RestTemplate();
// When called directly without a proxy, expect an exception to be thrown due to byteman rules
assertNetworkCallFails(restTemplate, new HttpComponentsClientHttpRequestFactory());
// Repeat that with different request factory used in the code as this exercises different byteman rules
assertNetworkCallFails(restTemplate, new SimpleClientHttpRequestFactory());
// And with the actual one used by RestUtil, without a proxy configured
assertNetworkCallFails(restTemplate, new RestUtil().createRequestFactory(null, false));