//iniRealm has a Sha256CredentialsMatcher enabled:
//try to log-in:
Subject subject = new Subject.Builder(sm).buildSubject();
//ensure thread clean-up after the login method returns. Test cases only:
subject.execute(new Runnable() {
public void run() {
//the plain-text 'secret' should be converted to an Sha256 hash first
//by the CredentialsMatcher. This should return quietly if
//this test case is valid:
SecurityUtils.getSubject().login(new UsernamePasswordToken("admin", "secret"));