@Test @RunWithCustomExecutor public void testFindAccessionRegisterDetail() throws Exception { VitamThreadUtils.getVitamSession().setTenantId(TENANT_ID); register = JsonHandler.getFromInputStream(PropertiesUtils.getResourceAsStream(FILE_TO_TEST_OK), AccessionRegisterDetailModel.class); ElasticsearchAccessFunctionalAdmin.ensureIndex(); register.setOriginatingAgency("testFindAccessionRegisterDetailAgency"); accessionRegisterImpl.createOrUpdateAccessionRegister(register); final MongoCollection<Document> collection = mongoRule.getMongoCollection(FunctionalAdminCollections.ACCESSION_REGISTER_SUMMARY.getName()); assertEquals(1, collection.countDocuments()); final Select select = new Select(); select.setQuery(eq("OriginatingAgency", "testFindAccessionRegisterDetailAgency")); final RequestResponseOK<AccessionRegisterDetail> detail = accessionRegisterImpl.findDetail(select.getFinalSelect()); assertEquals(1, detail.getResults().size()); final AccessionRegisterDetail item = detail.getResults().get(0); assertEquals("testFindAccessionRegisterDetailAgency", item.getOriginatingAgency()); }
private VitamDocument<AccessionRegisterDetail> findAccessionRegisterDetail(String originatingAgency, String opi) { Bson filterQuery = and(eq(AccessionRegisterDetail.ORIGINATING_AGENCY, originatingAgency), eq(AccessionRegisterDetail.OPI, opi)); return (VitamDocument<AccessionRegisterDetail>) FunctionalAdminCollections.ACCESSION_REGISTER_DETAIL .getCollection().find(filterQuery).iterator().next(); }
ReferentialAccessionRegisterImpl implements VitamAutoCloseable { private VitamDocument<AccessionRegisterDetail> findAccessionRegisterDetail(String originatingAgency, String opi) { Bson filterQuery = and(eq(AccessionRegisterDetail.ORIGINATING_AGENCY, originatingAgency), eq(AccessionRegisterDetail.OPI, opi)); return (VitamDocument<AccessionRegisterDetail>) FunctionalAdminCollections.ACCESSION_REGISTER_DETAIL .getCollection().find(filterQuery).iterator().next(); } }
ReferentialAccessionRegisterImpl implements VitamAutoCloseable { private VitamDocument<AccessionRegisterDetail> findAccessionRegisterDetail(String originatingAgency, String opi) { Bson filterQuery = and(eq(AccessionRegisterDetail.ORIGINATING_AGENCY, originatingAgency), eq(AccessionRegisterDetail.OPI, opi)); return (VitamDocument<AccessionRegisterDetail>) FunctionalAdminCollections.ACCESSION_REGISTER_DETAIL .getCollection().find(filterQuery).iterator().next(); } ReferentialAccessionRegisterImpl(MongoDbAccessAdminImpl dbConfiguration,
        VitamCounterService vitamCounterService);  ReferentialAccessionRegisterImpl(MongoDbAccessAdminImpl dbConfiguration,
        FunctionalBackupService functionalBackupService); }
ReferentialAccessionRegisterImpl implements VitamAutoCloseable { private VitamDocument<AccessionRegisterDetail> findAccessionRegisterDetail(String originatingAgency, String opi) { Bson filterQuery = and(eq(AccessionRegisterDetail.ORIGINATING_AGENCY, originatingAgency), eq(AccessionRegisterDetail.OPI, opi)); return (VitamDocument<AccessionRegisterDetail>) FunctionalAdminCollections.ACCESSION_REGISTER_DETAIL .getCollection().find(filterQuery).iterator().next(); } ReferentialAccessionRegisterImpl(MongoDbAccessAdminImpl dbConfiguration,
        VitamCounterService vitamCounterService);  ReferentialAccessionRegisterImpl(MongoDbAccessAdminImpl dbConfiguration,
        FunctionalBackupService functionalBackupService); void insertAccessionRegisterSymbolic(List<AccessionRegisterSymbolic> accessionRegisterSymbolics); List<AccessionRegisterSymbolic> findAccessionRegisterSymbolic(JsonNode queryDsl); void createOrUpdateAccessionRegister(AccessionRegisterDetailModel registerDetail); @Override void close(); RequestResponseOK<AccessionRegisterSummary> findDocuments(JsonNode select); RequestResponseOK<AccessionRegisterDetail> findDetail(JsonNode select); }
ReferentialAccessionRegisterImpl implements VitamAutoCloseable { private VitamDocument<AccessionRegisterDetail> findAccessionRegisterDetail(String originatingAgency, String opi) { Bson filterQuery = and(eq(AccessionRegisterDetail.ORIGINATING_AGENCY, originatingAgency), eq(AccessionRegisterDetail.OPI, opi)); return (VitamDocument<AccessionRegisterDetail>) FunctionalAdminCollections.ACCESSION_REGISTER_DETAIL .getCollection().find(filterQuery).iterator().next(); } ReferentialAccessionRegisterImpl(MongoDbAccessAdminImpl dbConfiguration,
        VitamCounterService vitamCounterService);  ReferentialAccessionRegisterImpl(MongoDbAccessAdminImpl dbConfiguration,
        FunctionalBackupService functionalBackupService); void insertAccessionRegisterSymbolic(List<AccessionRegisterSymbolic> accessionRegisterSymbolics); List<AccessionRegisterSymbolic> findAccessionRegisterSymbolic(JsonNode queryDsl); void createOrUpdateAccessionRegister(AccessionRegisterDetailModel registerDetail); @Override void close(); RequestResponseOK<AccessionRegisterSummary> findDocuments(JsonNode select); RequestResponseOK<AccessionRegisterDetail> findDetail(JsonNode select);  }