use of org.forgerock.http.protocol.Response in project OpenAM by OpenRock.
the class AbstractHttpAccessAuditFilterTest method mockHandler.
private Handler mockHandler(Context context, Request request, Status status) {
Handler handler = mock(Handler.class);
Promise<Response, NeverThrowsException> promise = newResultPromise(new Response(status));
given(handler.handle(context, request)).willReturn(promise);
return handler;
}
use of org.forgerock.http.protocol.Response in project OpenAM by OpenRock.
the class AbstractHttpAccessAuditFilterTest method shouldGetUserIdForAccessOutcomeIfNotSet.
@Test
public void shouldGetUserIdForAccessOutcomeIfNotSet() {
//Given
Response response = new Response();
AuditRequestContext.putProperty(USER_ID, null);
//When
String userId = auditFilter.getUserIdForAccessOutcome(response);
//Then
assertThat(userId).isEmpty();
}
Aggregations