constructor.setAccessible(true);
GeonetContext gc = (GeonetContext) constructor.newInstance(_applicationContext, false, null, null);
contexts.put(Geonet.CONTEXT_NAME, gc);
final ServiceContext context = new ServiceContext("mockService", _applicationContext, contexts, _entityManager);
context.setAsThreadLocal();
context.setInputMethod(ServiceRequest.InputMethod.GET);
context.setIpAddress("127.0.1");
context.setLanguage("eng");
context.setLogger(Log.createLogger("Test"));
context.setMaxUploadSize(100);
context.setOutputMethod(ServiceRequest.OutputMethod.DEFAULT);
context.setAppPath(getWebappDir(getClass()));
context.setBaseUrl("geonetwork");
return context;
}