#fixed code
                                @Test
    public void testReadinessCheckFailedHttpCode() {
        ResponseEntity<String> response = restTemplate.getForEntity("/health/readiness",
            String.class);
        Assert.assertEquals(HttpStatus.SERVICE_UNAVAILABLE, response.getStatusCode());
    }
#vulnerable code 
                                @Test
    public void testReadinessCheckFailedHttpCode() throws IOException {
        HttpURLConnection huc = (HttpURLConnection) (new URL(
            "http://localhost:8080/health/readiness").openConnection());
        huc.setRequestMethod("HEAD");
        huc.connect();
        int respCode = huc.getResponseCode();
        System.out.println(huc.getResponseMessage());
        Assert.assertEquals(503, respCode);
    } 
                            #location 8 
                            #vulnerability type RESOURCE_LEAK