Search in sources :

Example 1 with ServletCall

use of org.restlet.ext.servlet.internal.ServletCall in project OpenAM by OpenRock.

the class RestletRealmRouterTest method setUpRequest.

private Request setUpRequest(HttpServletRequest httpRequest, SSOToken adminToken) {
    HttpRequest request = generateRequest();
    ServletCall serverCall = mock(ServletCall.class);
    given(request.getHttpCall()).willReturn(serverCall);
    given(serverCall.getRequest()).willReturn(httpRequest);
    Reference reference = mock(Reference.class);
    given(request.getResourceRef()).willReturn(reference);
    Form queryForm = mock(Form.class);
    given(reference.getQueryAsForm()).willReturn(queryForm);
    Reference baseReference = mock(Reference.class);
    given(reference.getBaseRef()).willReturn(baseReference);
    given(baseReference.toString()).willReturn("The base url");
    given(coreWrapper.getAdminToken()).willReturn(adminToken);
    return request;
}
Also used : HttpRequest(org.restlet.engine.adapter.HttpRequest) ServletCall(org.restlet.ext.servlet.internal.ServletCall) Form(org.restlet.data.Form) Reference(org.restlet.data.Reference)

Aggregations

Form (org.restlet.data.Form)1 Reference (org.restlet.data.Reference)1 HttpRequest (org.restlet.engine.adapter.HttpRequest)1 ServletCall (org.restlet.ext.servlet.internal.ServletCall)1