this.credentials = mock(Credentials.class);
when(credentials.getPassword()).thenReturn("secret");
when(credentials.buildSession(dao, "bob")).thenReturn(session);
this.resource = new UserResource(dao, new Provider<SecureRandom>() {
@Override
public SecureRandom get() {
return random;
}
});