use of org.springframework.extensions.webscripts.AbstractWebScript in project records-management by Alfresco.
the class BaseWebScriptUnitTest method executeWebScript.
/**
* Execute web script and return result as a string.
*
* @param parameters map of all parameter values
* @return {@link String} result of web script
*/
protected String executeWebScript(Map<String, String> parameters, String content) throws Exception {
AbstractWebScript webScript = getWebScript();
String template = getWebScriptTemplate();
// initialise webscript
webScript.init(getMockedContainer(template), getMockedDescription());
// execute webscript
WebScriptResponse mockedResponse = getMockedWebScriptResponse();
webScript.execute(getMockedWebScriptRequest(webScript, parameters, content), mockedResponse);
// return results
return mockedResponse.getWriter().toString();
}
Aggregations