@Before
public void setUp() throws Exception {
ContextHolder.get().setCurrentContextId("foo");
UserDataManager userManager = new UserManagerStub();
userManager.createUser("testuser");
userManager.setUserCredentials("testuser", "password", "password");
userManager.setUserCredentials("testuser", "onetime-basecode", "90489");
userManager.setUserCredentials("testuser", "onetime-counter", "2");
UsernamePasswordServiceImpl authenticator1 = new UsernamePasswordServiceImpl();
authenticator1.setUserManager(userManager);
registerServiceAtLocation(authenticator1, "authenticator/password", AuthenticationDomain.class);
passwordAuthenticator = authenticator1;