* Some slight reflective manipulation of crmfMessageHandler here in
* order to get around the fact that we're not running any of the logic
* in its usual constructor, instead using the empty default one.
*/
SimpleMock.inject(crmfMessageHandler, "admin", new Admin(Admin.TYPE_RA_USER));
final UserAdminSessionRemote userAdminSessionMock = new SimpleMock(UserAdminSessionRemote.class) {{
map("findUserBySubjectDN", new UserDataVO() {
private static final long serialVersionUID = 1L;
public String getUsername() { return USER_NAME; };
});
}}.mock();
SimpleMock.inject(crmfMessageHandler, "userAdminSession", userAdminSessionMock);
SimpleMock.inject(crmfMessageHandler, "signSession", new SimpleMock(SignSessionRemote.class).mock());
final CrmfRequestMessage requestMock = new CrmfRequestMessage() {
private static final long serialVersionUID = 1L;
public String getSubjectDN() {
return "foo"; // Just return something that isn't null
}