SimpleApplicationWrapper implements ApplicationWrapper { @Override public Application getApplication() { try (RepositoryConnection conn = repository.getConnection()) { Model appModel = modelFactory.createModel(); conn.getStatements(factory.createIRI(NAMESPACE + applicationId), null, null).forEach(appModel::add); return appFactory.getExisting(factory.createIRI(NAMESPACE + applicationId), appModel).orElseThrow(() -> new IllegalStateException("Unable to retrieve application: " + NAMESPACE + applicationId)); } }  @Override void validateConfig(Map<String, Object> props); @Override String getId(); @Override Application getApplication();  }
@Test public void getApplicationTest() 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)); Application app = wrapper.getApplication(); assertNotEquals(app, null); assertTrue(app.getModel().contains(VALUE_FACTORY.createIRI(namespace + "id"), VALUE_FACTORY.createIRI(RDF.TYPE.stringValue()), VALUE_FACTORY.createIRI(Application.TYPE))); }