class AuthenticationUtil {

    public static void authenticate(String userId, String password)
        throws AuthenticationFailedException, UserIdLockedException, PasswordExpiredException {
        PasswordAuthenticator authenticator = SystemRepository.get(AUTHENTICATOR);
        authenticator.authenticate(userId, password);
    }

}

class AuthenticationUtilTest {

    private static PasswordAuthenticator defaultAuthenticator;
    private static PasswordEncryptor defaultPasswordEncryptor;

    @Test
    public void testAuthenticate() {

        MockAuthenticator sut = SystemRepository.get("authenticator");
        sut.called(1);
        sut.calledWith("userId", "password");
        AuthenticationUtil.authenticate("userId", "password");
        sut.verify("1度だけ呼び出され、引数がそのままauthenticatorに渡されていること。");
    }

}