@Test(expected = InvalidParseOperationException.class) public void given_empty_DSLWhen_select_unitById_ThenThrows_InvalidParseOperationException() throws Exception { doThrow(new InvalidParseOperationException("")).when(metaDataClient).selectUnitbyId(any(), any()); accessModuleImpl.selectUnitbyId(fromStringToJson(QUERY), ID); }
@Override public JsonNode selectUnitbyId(JsonNode jsonQuery, String idUnit) throws InvalidParseOperationException, AccessInternalExecutionException, MetaDataNotFoundException { final RequestParserMultiple parser = RequestParserHelper.getParser(jsonQuery.deepCopy()); parser.getRequest().reset(); if (!(parser instanceof SelectParserMultiple)) { throw new InvalidParseOperationException(NOT_A_SELECT_OPERATION); } return selectMetadataDocumentById(jsonQuery, idUnit, DataCategory.UNIT); }
AccessInternalModuleImpl implements AccessInternalModule { @Override public JsonNode selectUnitbyId(JsonNode jsonQuery, String idUnit) throws InvalidParseOperationException, AccessInternalExecutionException, MetaDataNotFoundException { final RequestParserMultiple parser = RequestParserHelper.getParser(jsonQuery.deepCopy()); parser.getRequest().reset(); if (!(parser instanceof SelectParserMultiple)) { throw new InvalidParseOperationException(NOT_A_SELECT_OPERATION); } return selectMetadataDocumentById(jsonQuery, idUnit, DataCategory.UNIT); } }
AccessInternalModuleImpl implements AccessInternalModule { @Override public JsonNode selectUnitbyId(JsonNode jsonQuery, String idUnit) throws InvalidParseOperationException, AccessInternalExecutionException, MetaDataNotFoundException { final RequestParserMultiple parser = RequestParserHelper.getParser(jsonQuery.deepCopy()); parser.getRequest().reset(); if (!(parser instanceof SelectParserMultiple)) { throw new InvalidParseOperationException(NOT_A_SELECT_OPERATION); } return selectMetadataDocumentById(jsonQuery, idUnit, DataCategory.UNIT); } AccessInternalModuleImpl(); @VisibleForTesting  AccessInternalModuleImpl(LogbookLifeCyclesClientFactory logbookLifeCyclesClientFactory,
        LogbookOperationsClientFactory logbookOperationsClientFactory, StorageClientFactory storageClientFactory,
        WorkspaceClientFactory workspaceClientFactory, AdminManagementClientFactory adminManagementClientFactory,
        MetaDataClientFactory metaDataClientFactory); }
AccessInternalModuleImpl implements AccessInternalModule { @Override public JsonNode selectUnitbyId(JsonNode jsonQuery, String idUnit) throws InvalidParseOperationException, AccessInternalExecutionException, MetaDataNotFoundException { final RequestParserMultiple parser = RequestParserHelper.getParser(jsonQuery.deepCopy()); parser.getRequest().reset(); if (!(parser instanceof SelectParserMultiple)) { throw new InvalidParseOperationException(NOT_A_SELECT_OPERATION); } return selectMetadataDocumentById(jsonQuery, idUnit, DataCategory.UNIT); } AccessInternalModuleImpl(); @VisibleForTesting  AccessInternalModuleImpl(LogbookLifeCyclesClientFactory logbookLifeCyclesClientFactory,
        LogbookOperationsClientFactory logbookOperationsClientFactory, StorageClientFactory storageClientFactory,
        WorkspaceClientFactory workspaceClientFactory, AdminManagementClientFactory adminManagementClientFactory,
        MetaDataClientFactory metaDataClientFactory); @Override JsonNode selectUnit(JsonNode jsonQuery); @Override JsonNode selectUnitbyId(JsonNode jsonQuery, String idUnit); @Override JsonNode selectObjectGroupById(JsonNode jsonQuery, String idObjectGroup); @Override Response getOneObjectFromObjectGroup(String idObjectGroup, String qualifier, int version, String idUnit); @Override Response getAccessLog(JsonNode params); void checkClassificationLevel(JsonNode query); @Override JsonNode updateUnitById(JsonNode queryJson, String idUnit, String requestId); @Override Response findDIPByOperationId(String id); @Override Response findTransferSIPByOperationId(String id); @Override JsonNode selectObjects(JsonNode jsonQuery); @Override JsonNode selectUnitsWithInheritedRules(JsonNode jsonQuery); }
AccessInternalModuleImpl implements AccessInternalModule { @Override public JsonNode selectUnitbyId(JsonNode jsonQuery, String idUnit) throws InvalidParseOperationException, AccessInternalExecutionException, MetaDataNotFoundException { final RequestParserMultiple parser = RequestParserHelper.getParser(jsonQuery.deepCopy()); parser.getRequest().reset(); if (!(parser instanceof SelectParserMultiple)) { throw new InvalidParseOperationException(NOT_A_SELECT_OPERATION); } return selectMetadataDocumentById(jsonQuery, idUnit, DataCategory.UNIT); } AccessInternalModuleImpl(); @VisibleForTesting  AccessInternalModuleImpl(LogbookLifeCyclesClientFactory logbookLifeCyclesClientFactory,
        LogbookOperationsClientFactory logbookOperationsClientFactory, StorageClientFactory storageClientFactory,
        WorkspaceClientFactory workspaceClientFactory, AdminManagementClientFactory adminManagementClientFactory,
        MetaDataClientFactory metaDataClientFactory); @Override JsonNode selectUnit(JsonNode jsonQuery); @Override JsonNode selectUnitbyId(JsonNode jsonQuery, String idUnit); @Override JsonNode selectObjectGroupById(JsonNode jsonQuery, String idObjectGroup); @Override Response getOneObjectFromObjectGroup(String idObjectGroup, String qualifier, int version, String idUnit); @Override Response getAccessLog(JsonNode params); void checkClassificationLevel(JsonNode query); @Override JsonNode updateUnitById(JsonNode queryJson, String idUnit, String requestId); @Override Response findDIPByOperationId(String id); @Override Response findTransferSIPByOperationId(String id); @Override JsonNode selectObjects(JsonNode jsonQuery); @Override JsonNode selectUnitsWithInheritedRules(JsonNode jsonQuery);  }