use of org.forgerock.json.resource.ResourceResponse in project OpenAM by OpenRock.
the class AuditFilterTest method shouldReturnNullForUpdateSuccess.
@Test
public void shouldReturnNullForUpdateSuccess() {
UpdateRequest updateRequest = mock(UpdateRequest.class);
ResourceResponse resourceResponse = mock(ResourceResponse.class);
JsonValue filterResponse = auditFilter.getUpdateSuccessDetail(updateRequest, resourceResponse);
assertThat(filterResponse).isEqualTo(null);
}
use of org.forgerock.json.resource.ResourceResponse in project OpenAM by OpenRock.
the class AuditFilterTest method shouldAuditSuccessForResults.
@Test
public void shouldAuditSuccessForResults() throws Exception {
ResourceResponse response = mock(ResourceResponse.class);
Promise<ResourceResponse, ResourceException> myPromise = Promises.newResultPromise(response);
given(filterChain.handleUpdate(any(Context.class), any(UpdateRequest.class))).willReturn(myPromise);
given(auditorFactory.create(context, updateRequest)).willReturn(auditor);
AuditFilter auditFilter = new AuditFilter(debug, auditorFactory);
auditFilter.filterUpdate(context, updateRequest, filterChain);
verify(auditor).auditAccessSuccess(null);
}
use of org.forgerock.json.resource.ResourceResponse in project OpenAM by OpenRock.
the class AuditFilterTest method shouldReturnNullForReadSuccess.
@Test
public void shouldReturnNullForReadSuccess() {
ReadRequest readRequest = mock(ReadRequest.class);
ResourceResponse resourceResponse = mock(ResourceResponse.class);
JsonValue filterResponse = auditFilter.getReadSuccessDetail(readRequest, resourceResponse);
assertThat(filterResponse).isEqualTo(null);
}
use of org.forgerock.json.resource.ResourceResponse in project OpenAM by OpenRock.
the class AuditFilterTest method shouldReturnNullForPatchSuccess.
@Test
public void shouldReturnNullForPatchSuccess() {
PatchRequest patchRequest = mock(PatchRequest.class);
ResourceResponse resourceResponse = mock(ResourceResponse.class);
JsonValue filterResponse = auditFilter.getPatchSuccessDetail(patchRequest, resourceResponse);
assertThat(filterResponse).isEqualTo(null);
}
use of org.forgerock.json.resource.ResourceResponse in project OpenAM by OpenRock.
the class KbaResource method readInstance.
@Override
public Promise<ResourceResponse, ResourceException> readInstance(Context context, ReadRequest readRequest) {
String realm = RealmContext.getRealm(context);
JsonValue kbaJson = configHandler.getConfig(realm, KbaBuilder.class);
ResourceResponse response = Responses.newResourceResponse("1", "1.0", kbaJson);
return Promises.newResultPromise(response);
}
Aggregations