@Test @RunWithCustomExecutor public void givenTestFindAllForCacheThenReturnEmpty() throws Exception { VitamThreadUtils.getVitamSession().setTenantId(TENANT_ID); final RequestResponseOK<OntologyModel> ontologyModelList = ontologyService.findOntologiesForCache(JsonHandler.createObjectNode()); assertThat(ontologyModelList.getResults()).isEmpty(); }
@Override public RequestResponseOK<OntologyModel> findOntologiesForCache(JsonNode queryDsl) throws InvalidParseOperationException { final RequestResponseOK<OntologyModel> response = new RequestResponseOK<>(queryDsl); FindIterable<Document> documents = FunctionalAdminCollections.ONTOLOGY.getCollection().find(); for (Document document : documents) { response.addResult(JsonHandler.getFromString(BsonHelper.stringify(document), OntologyModel.class)); } return response; }
OntologyServiceImpl implements OntologyService { @Override public RequestResponseOK<OntologyModel> findOntologiesForCache(JsonNode queryDsl) throws InvalidParseOperationException { final RequestResponseOK<OntologyModel> response = new RequestResponseOK<>(queryDsl); FindIterable<Document> documents = FunctionalAdminCollections.ONTOLOGY.getCollection().find(); for (Document document : documents) { response.addResult(JsonHandler.getFromString(BsonHelper.stringify(document), OntologyModel.class)); } return response; } }
OntologyServiceImpl implements OntologyService { @Override public RequestResponseOK<OntologyModel> findOntologiesForCache(JsonNode queryDsl) throws InvalidParseOperationException { final RequestResponseOK<OntologyModel> response = new RequestResponseOK<>(queryDsl); FindIterable<Document> documents = FunctionalAdminCollections.ONTOLOGY.getCollection().find(); for (Document document : documents) { response.addResult(JsonHandler.getFromString(BsonHelper.stringify(document), OntologyModel.class)); } return response; } OntologyServiceImpl(MongoDbAccessAdminImpl mongoAccess, FunctionalBackupService functionalBackupService); }
OntologyServiceImpl implements OntologyService { @Override public RequestResponseOK<OntologyModel> findOntologiesForCache(JsonNode queryDsl) throws InvalidParseOperationException { final RequestResponseOK<OntologyModel> response = new RequestResponseOK<>(queryDsl); FindIterable<Document> documents = FunctionalAdminCollections.ONTOLOGY.getCollection().find(); for (Document document : documents) { response.addResult(JsonHandler.getFromString(BsonHelper.stringify(document), OntologyModel.class)); } return response; } OntologyServiceImpl(MongoDbAccessAdminImpl mongoAccess, FunctionalBackupService functionalBackupService); @Override RequestResponse<OntologyModel> importOntologies(boolean forceUpdate, List<OntologyModel> ontologyModelList); @Override RequestResponseOK<OntologyModel> findOntologiesForCache(JsonNode queryDsl); @Override RequestResponseOK<OntologyModel> findOntologies(JsonNode queryDsl); @Override void close(); }
OntologyServiceImpl implements OntologyService { @Override public RequestResponseOK<OntologyModel> findOntologiesForCache(JsonNode queryDsl) throws InvalidParseOperationException { final RequestResponseOK<OntologyModel> response = new RequestResponseOK<>(queryDsl); FindIterable<Document> documents = FunctionalAdminCollections.ONTOLOGY.getCollection().find(); for (Document document : documents) { response.addResult(JsonHandler.getFromString(BsonHelper.stringify(document), OntologyModel.class)); } return response; } OntologyServiceImpl(MongoDbAccessAdminImpl mongoAccess, FunctionalBackupService functionalBackupService); @Override RequestResponse<OntologyModel> importOntologies(boolean forceUpdate, List<OntologyModel> ontologyModelList); @Override RequestResponseOK<OntologyModel> findOntologiesForCache(JsonNode queryDsl); @Override RequestResponseOK<OntologyModel> findOntologies(JsonNode queryDsl); @Override void close();  }