#fixed code
                                @Test
    public void constructorSetsHttpsMethodCorrectly(@Mocked final HttpConnection mockConn, final @Mocked URL mockUrl) throws IOException
    {
        // Arrange
        final HttpMethod httpsMethod = HttpMethod.GET;
        final byte[] body = new byte[0];
        new NonStrictExpectations()
        {
            {
                mockUrl.getProtocol();
                result = "http";
            }
        };
        // Act
        new HttpRequest(mockUrl, httpsMethod, body);
        // Assert
        new Verifications()
        {
            {
                new HttpConnection((URL) any, httpsMethod, (Proxy) any);
            }
        };
    }
#vulnerable code 
                                @Test
    public void constructorSetsHttpsMethodCorrectly(@Mocked final HttpConnection mockConn, final @Mocked URL mockUrl) throws IOException
    {
        // Arrange
        final HttpMethod httpsMethod = HttpMethod.GET;
        final byte[] body = new byte[0];
        new NonStrictExpectations()
        {
            {
                mockUrl.getProtocol();
                result = "http";
            }
        };
        // Act
        new HttpRequest(mockUrl, httpsMethod, body);
        // Assert
        new Verifications()
        {
            {
                new HttpConnection((URL) any, httpsMethod);
            }
        };
    } 
                            #location 15 
                            #vulnerability type RESOURCE_LEAK