@Test public void given_InvalidRequest_When_SelectObjectGroupById_ThenReturn_PreconditionFailed() { when(mock.get()).thenReturn(Response.status(Status.PRECONDITION_FAILED).build()); assertThatThrownBy(() -> client.selectObjectGrouptbyId(JsonHandler.getFromString(VALID_QUERY), "ogId")) .isInstanceOf(InvalidParseOperationException.class); }
@Override public JsonNode selectObjectGrouptbyId(JsonNode selectQuery, String objectGroupId) throws MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException { if (Strings.isNullOrEmpty(objectGroupId)) { throw new InvalidParseOperationException("objectGroupId may not be empty"); } try (Response response = make(get().withPath("/objectgroups/" + objectGroupId) .withBody(selectQuery, SELECT_OBJECT_GROUP_QUERY_NULL.getMessage()).withJson())) { check(response); return response.readEntity(JsonNode.class); } catch (IllegalArgumentException e) { throw new InvalidParseOperationException(e); } catch (VitamClientInternalException e) { throw new MetaDataClientServerException(e); } }
MetaDataClientRest extends DefaultClient implements MetaDataClient { @Override public JsonNode selectObjectGrouptbyId(JsonNode selectQuery, String objectGroupId) throws MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException { if (Strings.isNullOrEmpty(objectGroupId)) { throw new InvalidParseOperationException("objectGroupId may not be empty"); } try (Response response = make(get().withPath("/objectgroups/" + objectGroupId) .withBody(selectQuery, SELECT_OBJECT_GROUP_QUERY_NULL.getMessage()).withJson())) { check(response); return response.readEntity(JsonNode.class); } catch (IllegalArgumentException e) { throw new InvalidParseOperationException(e); } catch (VitamClientInternalException e) { throw new MetaDataClientServerException(e); } } }
MetaDataClientRest extends DefaultClient implements MetaDataClient { @Override public JsonNode selectObjectGrouptbyId(JsonNode selectQuery, String objectGroupId) throws MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException { if (Strings.isNullOrEmpty(objectGroupId)) { throw new InvalidParseOperationException("objectGroupId may not be empty"); } try (Response response = make(get().withPath("/objectgroups/" + objectGroupId) .withBody(selectQuery, SELECT_OBJECT_GROUP_QUERY_NULL.getMessage()).withJson())) { check(response); return response.readEntity(JsonNode.class); } catch (IllegalArgumentException e) { throw new InvalidParseOperationException(e); } catch (VitamClientInternalException e) { throw new MetaDataClientServerException(e); } } MetaDataClientRest(VitamClientFactoryInterface factory); }
MetaDataClientRest extends DefaultClient implements MetaDataClient { @Override public JsonNode selectObjectGrouptbyId(JsonNode selectQuery, String objectGroupId) throws MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException { if (Strings.isNullOrEmpty(objectGroupId)) { throw new InvalidParseOperationException("objectGroupId may not be empty"); } try (Response response = make(get().withPath("/objectgroups/" + objectGroupId) .withBody(selectQuery, SELECT_OBJECT_GROUP_QUERY_NULL.getMessage()).withJson())) { check(response); return response.readEntity(JsonNode.class); } catch (IllegalArgumentException e) { throw new InvalidParseOperationException(e); } catch (VitamClientInternalException e) { throw new MetaDataClientServerException(e); } } MetaDataClientRest(VitamClientFactoryInterface factory); @Override JsonNode insertUnitBulk(BulkUnitInsertRequest request); @Override JsonNode selectUnits(JsonNode selectQuery); @Override JsonNode selectObjectGroups(JsonNode selectQuery); @Override JsonNode selectUnitbyId(JsonNode selectQuery, String unitId); @Override JsonNode selectObjectGrouptbyId(JsonNode selectQuery, String objectGroupId); @Override JsonNode updateUnitById(JsonNode updateQuery, String unitId); @Override JsonNode insertObjectGroup(JsonNode insertQuery); @Override JsonNode insertObjectGroups(List<JsonNode> insertQueries); @Override void updateObjectGroupById(JsonNode queryUpdate, String objectGroupId); @Override List<UnitPerOriginatingAgency> selectAccessionRegisterOnUnitByOperationId(String operationId); @Override List<ObjectGroupPerOriginatingAgency> selectAccessionRegisterOnObjectByOperationId(String operationId); @Override boolean refreshUnits(); @Override boolean refreshObjectGroups(); @Override JsonNode reindex(IndexParameters indexParam); @Override JsonNode switchIndexes(SwitchIndexParameters switchIndexParam); @Override RequestResponse<JsonNode> getUnitByIdRaw(String unitId); @Override RequestResponse<JsonNode> getUnitsByIdsRaw(Collection<String> unitIds); @Override RequestResponse<JsonNode> getObjectGroupByIdRaw(String objectGroupId); @Override RequestResponse<JsonNode> getObjectGroupsByIdsRaw(Collection<String> objectGroupId); @Override GraphComputeResponse computeGraph(JsonNode queryDsl); @Override GraphComputeResponse computeGraph(GraphComputeResponse.GraphComputeAction action, Set<String> ids); @Override void exportReclassificationChildNodes(Set<String> ids, String unitsToUpdateJsonLineFileName,
        String objectGroupsToUpdateJsonLineFileName); @Override void deleteUnitsBulk(Collection<String> listIds); @Override void deleteObjectGroupBulk(Collection<String> listIds); RequestResponse<JsonNode> updateUnitBulk(JsonNode updateQuery); @Override RequestResponse<JsonNode> updateUnitsRulesBulk(List<String> unitsIds, RuleActions actions,
        Map<String, DurationData> rulesToDurationData); @Override JsonNode selectUnitsWithInheritedRules(JsonNode selectQuery); @Override JsonNode createAccessionRegisterSymbolic(); }
MetaDataClientRest extends DefaultClient implements MetaDataClient { @Override public JsonNode selectObjectGrouptbyId(JsonNode selectQuery, String objectGroupId) throws MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException { if (Strings.isNullOrEmpty(objectGroupId)) { throw new InvalidParseOperationException("objectGroupId may not be empty"); } try (Response response = make(get().withPath("/objectgroups/" + objectGroupId) .withBody(selectQuery, SELECT_OBJECT_GROUP_QUERY_NULL.getMessage()).withJson())) { check(response); return response.readEntity(JsonNode.class); } catch (IllegalArgumentException e) { throw new InvalidParseOperationException(e); } catch (VitamClientInternalException e) { throw new MetaDataClientServerException(e); } } MetaDataClientRest(VitamClientFactoryInterface factory); @Override JsonNode insertUnitBulk(BulkUnitInsertRequest request); @Override JsonNode selectUnits(JsonNode selectQuery); @Override JsonNode selectObjectGroups(JsonNode selectQuery); @Override JsonNode selectUnitbyId(JsonNode selectQuery, String unitId); @Override JsonNode selectObjectGrouptbyId(JsonNode selectQuery, String objectGroupId); @Override JsonNode updateUnitById(JsonNode updateQuery, String unitId); @Override JsonNode insertObjectGroup(JsonNode insertQuery); @Override JsonNode insertObjectGroups(List<JsonNode> insertQueries); @Override void updateObjectGroupById(JsonNode queryUpdate, String objectGroupId); @Override List<UnitPerOriginatingAgency> selectAccessionRegisterOnUnitByOperationId(String operationId); @Override List<ObjectGroupPerOriginatingAgency> selectAccessionRegisterOnObjectByOperationId(String operationId); @Override boolean refreshUnits(); @Override boolean refreshObjectGroups(); @Override JsonNode reindex(IndexParameters indexParam); @Override JsonNode switchIndexes(SwitchIndexParameters switchIndexParam); @Override RequestResponse<JsonNode> getUnitByIdRaw(String unitId); @Override RequestResponse<JsonNode> getUnitsByIdsRaw(Collection<String> unitIds); @Override RequestResponse<JsonNode> getObjectGroupByIdRaw(String objectGroupId); @Override RequestResponse<JsonNode> getObjectGroupsByIdsRaw(Collection<String> objectGroupId); @Override GraphComputeResponse computeGraph(JsonNode queryDsl); @Override GraphComputeResponse computeGraph(GraphComputeResponse.GraphComputeAction action, Set<String> ids); @Override void exportReclassificationChildNodes(Set<String> ids, String unitsToUpdateJsonLineFileName,
        String objectGroupsToUpdateJsonLineFileName); @Override void deleteUnitsBulk(Collection<String> listIds); @Override void deleteObjectGroupBulk(Collection<String> listIds); RequestResponse<JsonNode> updateUnitBulk(JsonNode updateQuery); @Override RequestResponse<JsonNode> updateUnitsRulesBulk(List<String> unitsIds, RuleActions actions,
        Map<String, DurationData> rulesToDurationData); @Override JsonNode selectUnitsWithInheritedRules(JsonNode selectQuery); @Override JsonNode createAccessionRegisterSymbolic();  }