private void doTestDigestDigestPasswords(String password, String digest, String digestedPassword) throws Exception { Context context = new TesterContext(); TesterMapRealm realm = new TesterMapRealm(); realm.setContainer(context); realm.setDigest(digest); realm.start(); realm.addUser(USER1, digestedPassword); Principal p = realm.authenticate(USER1, password); Assert.assertNotNull(p); Assert.assertEquals(USER1, p.getName()); }