#vulnerable code 
                                @Test
    public void shouldGetHelpfulErrorWhenTryingToConnectToHttpPort() throws Throwable
    {
        // Given
        //the http server needs some time to start up
        Thread.sleep( 2000 );
        Driver driver = GraphDatabase.driver( "bolt://localhost:7474", Config.build().withEncryptionLevel(
                Config.EncryptionLevel.NONE ).toConfig());

        // Expect
        exception.expect( ClientException.class );
        exception.expectMessage( "Server responded HTTP. Make sure you are not trying to connect to the http endpoint " +
                                 "(HTTP defaults to port 7474 whereas BOLT defaults to port 7687)" );

        // When
        driver.session();
    } 
                            #location 16 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void shouldGetHelpfulErrorWhenTryingToConnectToHttpPort() throws Throwable
    {
        // Given
        //the http server needs some time to start up
        Thread.sleep( 2000 );
        try( Driver driver = GraphDatabase.driver( "bolt://localhost:7474",
                Config.build().withEncryptionLevel( Config.EncryptionLevel.NONE ).toConfig() ) )
        {
            // Expect
            exception.expect( ClientException.class );
            exception.expectMessage(
                    "Server responded HTTP. Make sure you are not trying to connect to the http endpoint " +
                    "(HTTP defaults to port 7474 whereas BOLT defaults to port 7687)" );

            // When
            try(Session session = driver.session() ){}
        }
    }