@Test @RunWithCustomExecutor public void givenTestFindByFakeID() throws Exception { VitamThreadUtils.getVitamSession().setTenantId(TENANT_ID); final SelectParserSingle parser = new SelectParserSingle(new SingleVarNameAdapter()); final Select select = new Select(); parser.parse(select.getFinalSelect()); parser.addCondition(QueryHelper.eq("#id", "fakeid")); final JsonNode queryDsl = parser.getRequest().getFinalSelect(); final RequestResponseOK<ArchiveUnitProfileModel> profileModelList = archiveUnitProfileService.findArchiveUnitProfiles(queryDsl); assertThat(profileModelList.getResults()).isEmpty(); }
@Override public RequestResponseOK<ArchiveUnitProfileModel> findArchiveUnitProfiles(JsonNode queryDsl) throws ReferentialException, InvalidParseOperationException { try (DbRequestResult result = mongoAccess.findDocuments(queryDsl, FunctionalAdminCollections.ARCHIVE_UNIT_PROFILE)) { return result.getRequestResponseOK(queryDsl, ArchiveUnitProfile.class, ArchiveUnitProfileModel.class); } }
ArchiveUnitProfileServiceImpl implements ArchiveUnitProfileService { @Override public RequestResponseOK<ArchiveUnitProfileModel> findArchiveUnitProfiles(JsonNode queryDsl) throws ReferentialException, InvalidParseOperationException { try (DbRequestResult result = mongoAccess.findDocuments(queryDsl, FunctionalAdminCollections.ARCHIVE_UNIT_PROFILE)) { return result.getRequestResponseOK(queryDsl, ArchiveUnitProfile.class, ArchiveUnitProfileModel.class); } } }
ArchiveUnitProfileServiceImpl implements ArchiveUnitProfileService { @Override public RequestResponseOK<ArchiveUnitProfileModel> findArchiveUnitProfiles(JsonNode queryDsl) throws ReferentialException, InvalidParseOperationException { try (DbRequestResult result = mongoAccess.findDocuments(queryDsl, FunctionalAdminCollections.ARCHIVE_UNIT_PROFILE)) { return result.getRequestResponseOK(queryDsl, ArchiveUnitProfile.class, ArchiveUnitProfileModel.class); } } ArchiveUnitProfileServiceImpl(MongoDbAccessAdminImpl mongoAccess,
        VitamCounterService vitamCounterService, FunctionalBackupService functionalBackupService); @VisibleForTesting  ArchiveUnitProfileServiceImpl(MongoDbAccessAdminImpl mongoAccess,
        VitamCounterService vitamCounterService, FunctionalBackupService functionalBackupService,
        boolean checkOntology); }
ArchiveUnitProfileServiceImpl implements ArchiveUnitProfileService { @Override public RequestResponseOK<ArchiveUnitProfileModel> findArchiveUnitProfiles(JsonNode queryDsl) throws ReferentialException, InvalidParseOperationException { try (DbRequestResult result = mongoAccess.findDocuments(queryDsl, FunctionalAdminCollections.ARCHIVE_UNIT_PROFILE)) { return result.getRequestResponseOK(queryDsl, ArchiveUnitProfile.class, ArchiveUnitProfileModel.class); } } ArchiveUnitProfileServiceImpl(MongoDbAccessAdminImpl mongoAccess,
        VitamCounterService vitamCounterService, FunctionalBackupService functionalBackupService); @VisibleForTesting  ArchiveUnitProfileServiceImpl(MongoDbAccessAdminImpl mongoAccess,
        VitamCounterService vitamCounterService, FunctionalBackupService functionalBackupService,
        boolean checkOntology); @Override RequestResponse<ArchiveUnitProfileModel> createArchiveUnitProfiles(
        List<ArchiveUnitProfileModel> profileModelList); @Override RequestResponseOK<ArchiveUnitProfileModel> findArchiveUnitProfiles(JsonNode queryDsl); @Override RequestResponse updateArchiveUnitProfile(String id, JsonNode queryDsl); @Override void close(); @VisibleForTesting ArchiveUnitProfileModel findByIdentifier(String id); }
ArchiveUnitProfileServiceImpl implements ArchiveUnitProfileService { @Override public RequestResponseOK<ArchiveUnitProfileModel> findArchiveUnitProfiles(JsonNode queryDsl) throws ReferentialException, InvalidParseOperationException { try (DbRequestResult result = mongoAccess.findDocuments(queryDsl, FunctionalAdminCollections.ARCHIVE_UNIT_PROFILE)) { return result.getRequestResponseOK(queryDsl, ArchiveUnitProfile.class, ArchiveUnitProfileModel.class); } } ArchiveUnitProfileServiceImpl(MongoDbAccessAdminImpl mongoAccess,
        VitamCounterService vitamCounterService, FunctionalBackupService functionalBackupService); @VisibleForTesting  ArchiveUnitProfileServiceImpl(MongoDbAccessAdminImpl mongoAccess,
        VitamCounterService vitamCounterService, FunctionalBackupService functionalBackupService,
        boolean checkOntology); @Override RequestResponse<ArchiveUnitProfileModel> createArchiveUnitProfiles(
        List<ArchiveUnitProfileModel> profileModelList); @Override RequestResponseOK<ArchiveUnitProfileModel> findArchiveUnitProfiles(JsonNode queryDsl); @Override RequestResponse updateArchiveUnitProfile(String id, JsonNode queryDsl); @Override void close(); @VisibleForTesting ArchiveUnitProfileModel findByIdentifier(String id); static final String ARCHIVE_UNIT_PROFILE_IDENTIFIER_ALREADY_EXISTS_IN_DATABASE; static final String ARCHIVE_UNIT_PROFILE_IDENTIFIER_MUST_BE_STRING; }