#fixed code
                                @Test
    public void shouldNotAllowNewTxWhileOneIsRunning() throws Throwable
    {
        // Given
        when( mock.isOpen() ).thenReturn( true );
        sess.beginTransaction();

        // Expect
        exception.expect( ClientException.class );

        // When
        sess.beginTransaction();
    }
#vulnerable code 
                                @Test
    public void shouldNotAllowNewTxWhileOneIsRunning() throws Throwable
    {
        // Given
        Connection mock = mock( Connection.class );
        when( mock.isOpen() ).thenReturn( true );
        InternalSession sess = new InternalSession( mock );
        sess.beginTransaction();

        // Expect
        exception.expect( ClientException.class );

        // When
        sess.beginTransaction();
    } 
                            #location 15 
                            #vulnerability type RESOURCE_LEAK