use of org.forgerock.openam.scripting.rest.ScriptExceptionMappingHandler in project OpenAM by OpenRock.
the class ScriptResourceTest method setUp.
@BeforeMethod
public void setUp() throws ResourceException {
Logger logger = mock(Logger.class);
ScriptingService scriptingService = new MockScriptingService();
ScriptingServiceFactory serviceFactory = mock(ScriptingServiceFactory.class);
when(serviceFactory.create(any(Subject.class), anyString())).thenReturn(scriptingService);
ExceptionMappingHandler<ScriptException, ResourceException> errorHandler = new ScriptExceptionMappingHandler();
scriptResource = new ScriptResource(logger, serviceFactory, errorHandler, new StandardScriptValidator(new StandardScriptEngineManager()));
context = mock(Context.class);
given(context.asContext(HttpContext.class)).willReturn(new HttpContext(json(object(field("headers", Collections.emptyMap()), field("parameters", Collections.emptyMap()))), null));
}
Aggregations