DirContext ctx = idf.newInitialDirContext(); fail("Authentication with wrong credentials should fail.");
ctx = idf.newInitialDirContext(); fail("Binding with wrong credentials should fail.");
    public void testInvalidPasswordCausesBadCredentialsException() throws Exception {        idf.setManagerDn(MANAGER_USER);        idf.setManagerPassword("wrongpassword");        try {            DirContext ctx = idf.newInitialDirContext();            fail("Authentication with wrong credentials should fail.");        } catch(BadCredentialsException expected) {        }    }