@Test public void givenMockExists_whenSelectUnitById_ThenReturnOK() throws Exception { AccessInternalClientFactory.changeMode(null); final AccessInternalClient client = AccessInternalClientFactory.getInstance().getClient(); assertNotNull(client); final JsonNode queryJson = JsonHandler.getFromString(queryDsql); assertThat(client.selectUnitbyId(queryJson, ID)).isNotNull(); }
@Override public RequestResponse<JsonNode> selectUnitbyId(JsonNode sqlQuery, String id) throws InvalidParseOperationException { return new RequestResponseOK().addResult(JsonHandler.getFromString( "{$hint: {'total':'1'},$context:{$query: {$eq: {\"id\" : \"1\" }}, $projection: {}, $filter: {}},$result:[{'#id': '1', 'Title': 'Archive 1', 'DescriptionLevel': 'Archive Mock'}]}")); }
AccessInternalClientMock extends AbstractMockClient implements AccessInternalClient { @Override public RequestResponse<JsonNode> selectUnitbyId(JsonNode sqlQuery, String id) throws InvalidParseOperationException { return new RequestResponseOK().addResult(JsonHandler.getFromString( "{$hint: {'total':'1'},$context:{$query: {$eq: {\"id\" : \"1\" }}, $projection: {}, $filter: {}},$result:[{'#id': '1', 'Title': 'Archive 1', 'DescriptionLevel': 'Archive Mock'}]}")); } }
AccessInternalClientMock extends AbstractMockClient implements AccessInternalClient { @Override public RequestResponse<JsonNode> selectUnitbyId(JsonNode sqlQuery, String id) throws InvalidParseOperationException { return new RequestResponseOK().addResult(JsonHandler.getFromString( "{$hint: {'total':'1'},$context:{$query: {$eq: {\"id\" : \"1\" }}, $projection: {}, $filter: {}},$result:[{'#id': '1', 'Title': 'Archive 1', 'DescriptionLevel': 'Archive Mock'}]}")); }  }
AccessInternalClientMock extends AbstractMockClient implements AccessInternalClient { @Override public RequestResponse<JsonNode> selectUnitbyId(JsonNode sqlQuery, String id) throws InvalidParseOperationException { return new RequestResponseOK().addResult(JsonHandler.getFromString( "{$hint: {'total':'1'},$context:{$query: {$eq: {\"id\" : \"1\" }}, $projection: {}, $filter: {}},$result:[{'#id': '1', 'Title': 'Archive 1', 'DescriptionLevel': 'Archive Mock'}]}")); }  @Override RequestResponse<JsonNode> selectUnits(JsonNode selectQuery); @Override RequestResponse<JsonNode> selectUnitbyId(JsonNode sqlQuery, String id); @Override RequestResponse<JsonNode> updateUnitbyId(JsonNode updateQuery, String unitId); @Override RequestResponse<JsonNode> updateUnits(JsonNode updateQuery); @Override RequestResponse<JsonNode> updateUnitsRules(MassUpdateUnitRuleRequest massUpdateUnitRuleRequest); @Override RequestResponse<JsonNode> selectObjectbyId(JsonNode selectObjectQuery, String objectId); @Override Response getObject(String objectGroupId, String usage, int version, String unitId); @Override RequestResponse<JsonNode> selectOperation(JsonNode select); @Override RequestResponse<JsonNode> selectOperationSliced(JsonNode select); @Override RequestResponse<JsonNode> selectOperationById(String processId, JsonNode queryDsl); @Override RequestResponse<JsonNode> selectUnitLifeCycleById(String idUnit, JsonNode queryDsl); @Override RequestResponse<JsonNode> selectObjectGroupLifeCycleById(String idObject, JsonNode queryDsl); @SuppressWarnings("unchecked") @Override RequestResponse<JsonNode> checkTraceabilityOperation(JsonNode query); @Override Response downloadTraceabilityFile(String operationId); @Override Response downloadAccessLogFile(JsonNode params); @Override RequestResponse<JsonNode> exportDIP(JsonNode dslRequest); @Override RequestResponse<JsonNode> exportByUsageFilter(ExportRequest exportRequest); @Override Response findExportByID(String id); @Override Response findTransferSIPByID(String id); @Override RequestResponse<JsonNode> reclassification(JsonNode reclassificationRequest); @Override RequestResponse<JsonNode> selectObjects(JsonNode selectQuery); @Override RequestResponse<JsonNode> selectUnitsWithInheritedRules(JsonNode selectQuery); @Override RequestResponse<JsonNode> startEliminationAnalysis(EliminationRequestBody eliminationRequestBody); @Override RequestResponse<JsonNode> startEliminationAction(EliminationRequestBody eliminationRequestBody); @Override RequestResponse<JsonNode> startPreservation(PreservationRequest preservationRequest); @Override RequestResponse<JsonNode> startComputeInheritedRules(JsonNode dslQuery); @Override RequestResponse<JsonNode> deleteComputeInheritedRules(JsonNode dslQuery); @Override RequestResponse<JsonNode> startTransferReplyWorkflow(InputStream transferReply); }
AccessInternalClientMock extends AbstractMockClient implements AccessInternalClient { @Override public RequestResponse<JsonNode> selectUnitbyId(JsonNode sqlQuery, String id) throws InvalidParseOperationException { return new RequestResponseOK().addResult(JsonHandler.getFromString( "{$hint: {'total':'1'},$context:{$query: {$eq: {\"id\" : \"1\" }}, $projection: {}, $filter: {}},$result:[{'#id': '1', 'Title': 'Archive 1', 'DescriptionLevel': 'Archive Mock'}]}")); }  @Override RequestResponse<JsonNode> selectUnits(JsonNode selectQuery); @Override RequestResponse<JsonNode> selectUnitbyId(JsonNode sqlQuery, String id); @Override RequestResponse<JsonNode> updateUnitbyId(JsonNode updateQuery, String unitId); @Override RequestResponse<JsonNode> updateUnits(JsonNode updateQuery); @Override RequestResponse<JsonNode> updateUnitsRules(MassUpdateUnitRuleRequest massUpdateUnitRuleRequest); @Override RequestResponse<JsonNode> selectObjectbyId(JsonNode selectObjectQuery, String objectId); @Override Response getObject(String objectGroupId, String usage, int version, String unitId); @Override RequestResponse<JsonNode> selectOperation(JsonNode select); @Override RequestResponse<JsonNode> selectOperationSliced(JsonNode select); @Override RequestResponse<JsonNode> selectOperationById(String processId, JsonNode queryDsl); @Override RequestResponse<JsonNode> selectUnitLifeCycleById(String idUnit, JsonNode queryDsl); @Override RequestResponse<JsonNode> selectObjectGroupLifeCycleById(String idObject, JsonNode queryDsl); @SuppressWarnings("unchecked") @Override RequestResponse<JsonNode> checkTraceabilityOperation(JsonNode query); @Override Response downloadTraceabilityFile(String operationId); @Override Response downloadAccessLogFile(JsonNode params); @Override RequestResponse<JsonNode> exportDIP(JsonNode dslRequest); @Override RequestResponse<JsonNode> exportByUsageFilter(ExportRequest exportRequest); @Override Response findExportByID(String id); @Override Response findTransferSIPByID(String id); @Override RequestResponse<JsonNode> reclassification(JsonNode reclassificationRequest); @Override RequestResponse<JsonNode> selectObjects(JsonNode selectQuery); @Override RequestResponse<JsonNode> selectUnitsWithInheritedRules(JsonNode selectQuery); @Override RequestResponse<JsonNode> startEliminationAnalysis(EliminationRequestBody eliminationRequestBody); @Override RequestResponse<JsonNode> startEliminationAction(EliminationRequestBody eliminationRequestBody); @Override RequestResponse<JsonNode> startPreservation(PreservationRequest preservationRequest); @Override RequestResponse<JsonNode> startComputeInheritedRules(JsonNode dslQuery); @Override RequestResponse<JsonNode> deleteComputeInheritedRules(JsonNode dslQuery); @Override RequestResponse<JsonNode> startTransferReplyWorkflow(InputStream transferReply);  }