SimpleApplicationWrapper implements ApplicationWrapper { @Modified protected void modified(Map<String, Object> props) { stop(); start(props); }  @Override void validateConfig(Map<String, Object> props); @Override String getId(); @Override Application getApplication();  }
@Test public void modifiedTest() throws Exception { wrapper.applicationId = "id"; RepositoryConnection conn = repo.getConnection(); conn.add(VALUE_FACTORY.createIRI(namespace + "id"), VALUE_FACTORY.createIRI(RDF.TYPE.stringValue()), VALUE_FACTORY.createIRI(Application.TYPE)); Map<String, Object> props = new HashMap<>(); props.put("id", "new"); props.put("title", "Title"); props.put("description", "Description"); wrapper.modified(props); assertFalse(conn.getStatements(VALUE_FACTORY.createIRI(namespace + "id"), null, null).hasNext()); assertEquals(props.get("id").toString(), wrapper.applicationId); Resource appIri = VALUE_FACTORY.createIRI(namespace + props.get("id")); Model appModel = MODEL_FACTORY.createModel(); conn.getStatements(appIri, null, null).forEach(appModel::add); assertFalse(appModel.isEmpty()); assertTrue(appModel.contains(appIri, VALUE_FACTORY.createIRI(RDF.TYPE.stringValue()), VALUE_FACTORY.createIRI(Application.TYPE))); assertTrue(appModel.contains(appIri, VALUE_FACTORY.createIRI(DCTERMS.TITLE.stringValue()), VALUE_FACTORY.createLiteral(props.get("title").toString()))); assertTrue(appModel.contains(appIri, VALUE_FACTORY.createIRI(DCTERMS.DESCRIPTION.stringValue()), VALUE_FACTORY.createLiteral(props.get("description").toString()))); conn.close(); }