@Test(expected = InvalidParseOperationException.class) public void given_empty_query_When_selectUnitById_ThenThrow_MetaDataExecutionException() throws Exception { List<OntologyModel> ontologyModels = emptyList(); when(adminManagementClient.findOntologies(any())) .thenReturn(new RequestResponseOK<OntologyModel>().addAllResults(ontologyModels)); metaDataImpl.selectUnitsById(JsonHandler.getFromString(""), "unitId"); }
public RequestResponse<JsonNode> selectUnitsById(JsonNode selectQuery, String unitId) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataDocumentSizeException, MetaDataNotFoundException, BadRequestException, VitamDBException { LOGGER.debug("SelectUnitsById/ selectQuery: " + selectQuery); return selectMetadataObject(selectQuery, unitId, singletonList(BuilderToken.FILTERARGS.UNITS)); }
MetaDataImpl { public RequestResponse<JsonNode> selectUnitsById(JsonNode selectQuery, String unitId) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataDocumentSizeException, MetaDataNotFoundException, BadRequestException, VitamDBException { LOGGER.debug("SelectUnitsById/ selectQuery: " + selectQuery); return selectMetadataObject(selectQuery, unitId, singletonList(BuilderToken.FILTERARGS.UNITS)); } }
MetaDataImpl { public RequestResponse<JsonNode> selectUnitsById(JsonNode selectQuery, String unitId) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataDocumentSizeException, MetaDataNotFoundException, BadRequestException, VitamDBException { LOGGER.debug("SelectUnitsById/ selectQuery: " + selectQuery); return selectMetadataObject(selectQuery, unitId, singletonList(BuilderToken.FILTERARGS.UNITS)); } MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess,
        int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds,
        int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds,
        int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds); @VisibleForTesting  MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess,
        AdminManagementClientFactory adminManagementClientFactory,
        IndexationHelper indexationHelper,
        DbRequest dbRequest, int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds,
        int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds,
        int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds); }
MetaDataImpl { public RequestResponse<JsonNode> selectUnitsById(JsonNode selectQuery, String unitId) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataDocumentSizeException, MetaDataNotFoundException, BadRequestException, VitamDBException { LOGGER.debug("SelectUnitsById/ selectQuery: " + selectQuery); return selectMetadataObject(selectQuery, unitId, singletonList(BuilderToken.FILTERARGS.UNITS)); } MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess,
        int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds,
        int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds,
        int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds); @VisibleForTesting  MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess,
        AdminManagementClientFactory adminManagementClientFactory,
        IndexationHelper indexationHelper,
        DbRequest dbRequest, int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds,
        int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds,
        int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds); static MetaDataImpl newMetadata(MongoDbAccessMetadataImpl mongoDbAccessMetadata,
        int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds,
        int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds,
        int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds); MongoDbAccessMetadataImpl getMongoDbAccess(); void insertUnits(BulkUnitInsertRequest request); void deleteUnits(List<String> idList); void deleteObjectGroups(List<String> idList); void insertObjectGroup(JsonNode objectGroupRequest); void insertObjectGroups(List<JsonNode> objectGroupRequest); List<FacetBucket> selectOwnAccessionRegisterOnUnitByOperationId(String operationId); List<Document> createAccessionRegisterSymbolic(Integer tenant); List<ObjectGroupPerOriginatingAgency> selectOwnAccessionRegisterOnObjectGroupByOperationId(Integer tenant,
        String operationId); RequestResponse<JsonNode> selectUnitsByQuery(JsonNode selectQuery); RequestResponse<JsonNode> selectObjectGroupsByQuery(JsonNode selectQuery); RequestResponse<JsonNode> selectUnitsById(JsonNode selectQuery, String unitId); RequestResponse<JsonNode> selectObjectGroupById(JsonNode selectQuery, String objectGroupId); void updateObjectGroupId(JsonNode updateQuery, String objectId); RequestResponse<UpdateUnit> updateUnits(JsonNode updateQuery); RequestResponse<UpdateUnit> updateUnitsRules(List<String> unitIds, RuleActions ruleActions,
        Map<String, DurationData> bindRuleToDuration); UpdateUnit updateUnitById(JsonNode updateQuery, String unitId); void refreshUnit(); void refreshObjectGroup(); IndexationResult reindex(IndexParameters indexParam); void switchIndex(String alias, String newIndexName); }
MetaDataImpl { public RequestResponse<JsonNode> selectUnitsById(JsonNode selectQuery, String unitId) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataDocumentSizeException, MetaDataNotFoundException, BadRequestException, VitamDBException { LOGGER.debug("SelectUnitsById/ selectQuery: " + selectQuery); return selectMetadataObject(selectQuery, unitId, singletonList(BuilderToken.FILTERARGS.UNITS)); } MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess,
        int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds,
        int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds,
        int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds); @VisibleForTesting  MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess,
        AdminManagementClientFactory adminManagementClientFactory,
        IndexationHelper indexationHelper,
        DbRequest dbRequest, int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds,
        int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds,
        int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds); static MetaDataImpl newMetadata(MongoDbAccessMetadataImpl mongoDbAccessMetadata,
        int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds,
        int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds,
        int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds); MongoDbAccessMetadataImpl getMongoDbAccess(); void insertUnits(BulkUnitInsertRequest request); void deleteUnits(List<String> idList); void deleteObjectGroups(List<String> idList); void insertObjectGroup(JsonNode objectGroupRequest); void insertObjectGroups(List<JsonNode> objectGroupRequest); List<FacetBucket> selectOwnAccessionRegisterOnUnitByOperationId(String operationId); List<Document> createAccessionRegisterSymbolic(Integer tenant); List<ObjectGroupPerOriginatingAgency> selectOwnAccessionRegisterOnObjectGroupByOperationId(Integer tenant,
        String operationId); RequestResponse<JsonNode> selectUnitsByQuery(JsonNode selectQuery); RequestResponse<JsonNode> selectObjectGroupsByQuery(JsonNode selectQuery); RequestResponse<JsonNode> selectUnitsById(JsonNode selectQuery, String unitId); RequestResponse<JsonNode> selectObjectGroupById(JsonNode selectQuery, String objectGroupId); void updateObjectGroupId(JsonNode updateQuery, String objectId); RequestResponse<UpdateUnit> updateUnits(JsonNode updateQuery); RequestResponse<UpdateUnit> updateUnitsRules(List<String> unitIds, RuleActions ruleActions,
        Map<String, DurationData> bindRuleToDuration); UpdateUnit updateUnitById(JsonNode updateQuery, String unitId); void refreshUnit(); void refreshObjectGroup(); IndexationResult reindex(IndexParameters indexParam); void switchIndex(String alias, String newIndexName);  }