@Test
public void getConnectionWhenMissingHook() throws Exception {

    expect(mockContext.lookup(eq("java:comp/env/notexisting"))).andThrow(
            new NamingException("TEST"));
    EasyMockUnitils.replay();
    try {
        factory.getConnection("notexisting");
        fail("DatabaseException expected");
    } catch (DatabaseException e) {
        // ok, expected
    }
}