Get implements Service { public Element exec(Element params, ServiceContext context) throws Exception { GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME); boolean asTree = Util.getParam(params, "asTree", "true").equals("true"); Element system = gc.getBean(SettingManager.class).getAllAsXML(asTree); return system; }  void init(Path appPath, ServiceConfig params); Element exec(Element params, ServiceContext context);  }
@Test public void testExec() throws Exception { ServiceContext context = createServiceContext(); loginAsAdmin(context); final Get getService = new Get(); final Element result = getService.exec(createParams(), context); assertEqualsText("false", result, Settings.SYSTEM_CSW_METADATA_PUBLIC); assertEqualsText("-1", result, Settings.SYSTEM_CSW_CAPABILITY_RECORD_UUID); assertEquals(Settings.SYSTEM_CSW_CAPABILITY_RECORD_UUID, Xml.selectElement(result, Settings.SYSTEM_CSW_CAPABILITY_RECORD_UUID).getAttributeValue("name")); assertEquals("system/csw", Xml.selectElement(result, "system/csw").getAttributeValue("name")); assertEqualsText("true", result, Settings.SYSTEM_CSW_ENABLE); }