use of org.forgerock.openam.entitlement.rest.PolicyV1Filter in project OpenAM by OpenRock.
the class PolicyV1FilterTest method setUp.
@BeforeMethod
public void setUp() {
MockitoAnnotations.initMocks(this);
EntitlementsExceptionMappingHandler resourceErrorHandler = new EntitlementsExceptionMappingHandler(EntitlementRestGuiceModule.getEntitlementsErrorHandlers());
filter = new PolicyV1Filter(applicationServiceFactory, resourceErrorHandler, contextHelper, debug);
subject = new Subject();
when(requestHandler.handleAction(any(Context.class), any(ActionRequest.class))).thenReturn(Promises.<ActionResponse, ResourceException>newResultPromise(newActionResponse((json(object(field("ttl", "1234567890")))))));
when(requestHandler.handleCreate(any(Context.class), any(CreateRequest.class))).thenReturn(Promises.<ResourceResponse, ResourceException>newResultPromise(newResourceResponse("A", "1", (json(object(field("resourceTypeUuid", "abc-def-hij")))))));
when(requestHandler.handleUpdate(any(Context.class), any(UpdateRequest.class))).thenReturn(Promises.<ResourceResponse, ResourceException>newResultPromise(newResourceResponse("A", "1", (json(object(field("resourceTypeUuid", "abc-def-hij")))))));
when(requestHandler.handleRead(any(Context.class), any(ReadRequest.class))).thenReturn(Promises.<ResourceResponse, ResourceException>newResultPromise(newResourceResponse("A", "1", (json(object(field("resourceTypeUuid", "abc-def-hij")))))));
}
Aggregations