@Test @RunWithCustomExecutor public void givenClientMockWhenfindAccessContracts() throws Exception { VitamThreadUtils.getVitamSession().setTenantId(TENANT_ID); RequestResponse resp = client.findAccessContracts(JsonHandler.createObjectNode()); assertThat(RequestResponseOK.class).isAssignableFrom(resp.getClass()); assertThat(((RequestResponseOK) resp).isOk()); assertThat(((RequestResponseOK) resp).getResults()).hasSize(1); }
@Override public RequestResponse findAccessContracts(JsonNode queryDsl) throws InvalidParseOperationException, AdminManagementClientServerException { LOGGER.debug("find access contracts request "); if (VitamThreadUtils.getVitamSession().getTenantId() == null) { VitamThreadUtils.getVitamSession().setTenantId(0); } AccessContractModel model = JsonHandler.getFromString(ClientMockResultHelper.ACCESS_CONTRACTS, AccessContractModel.class); return ClientMockResultHelper.createResponse(model); }
AdminManagementClientMock extends AbstractMockClient implements AdminManagementClient { @Override public RequestResponse findAccessContracts(JsonNode queryDsl) throws InvalidParseOperationException, AdminManagementClientServerException { LOGGER.debug("find access contracts request "); if (VitamThreadUtils.getVitamSession().getTenantId() == null) { VitamThreadUtils.getVitamSession().setTenantId(0); } AccessContractModel model = JsonHandler.getFromString(ClientMockResultHelper.ACCESS_CONTRACTS, AccessContractModel.class); return ClientMockResultHelper.createResponse(model); } }
AdminManagementClientMock extends AbstractMockClient implements AdminManagementClient { @Override public RequestResponse findAccessContracts(JsonNode queryDsl) throws InvalidParseOperationException, AdminManagementClientServerException { LOGGER.debug("find access contracts request "); if (VitamThreadUtils.getVitamSession().getTenantId() == null) { VitamThreadUtils.getVitamSession().setTenantId(0); } AccessContractModel model = JsonHandler.getFromString(ClientMockResultHelper.ACCESS_CONTRACTS, AccessContractModel.class); return ClientMockResultHelper.createResponse(model); }  }
AdminManagementClientMock extends AbstractMockClient implements AdminManagementClient { @Override public RequestResponse findAccessContracts(JsonNode queryDsl) throws InvalidParseOperationException, AdminManagementClientServerException { LOGGER.debug("find access contracts request "); if (VitamThreadUtils.getVitamSession().getTenantId() == null) { VitamThreadUtils.getVitamSession().setTenantId(0); } AccessContractModel model = JsonHandler.getFromString(ClientMockResultHelper.ACCESS_CONTRACTS, AccessContractModel.class); return ClientMockResultHelper.createResponse(model); }  @Override Response checkFormat(InputStream stream); @Override Status importFormat(InputStream stream, String filename); @Override JsonNode getFormatByID(String id); @Override RequestResponse<FileFormatModel> getFormats(JsonNode query); @Override Response checkRulesFile(InputStream stream); @Override Response checkAgenciesFile(InputStream stream); @Override Status importRulesFile(InputStream stream, String filename); @Override Status importAgenciesFile(InputStream stream, String filename); @Override JsonNode getAgencies(JsonNode query); @Override JsonNode getRuleByID(String id); @Override RequestResponse<AgenciesModel> getAgencyById(String id); @Override JsonNode getRules(JsonNode query); @Override RequestResponse createOrUpdateAccessionRegister(AccessionRegisterDetailModel register); @Override RequestResponse getAccessionRegister(JsonNode query); @Override RequestResponse getAccessionRegisterDetail(String originatingAgency, JsonNode query); @Override RequestResponse<AccessionRegisterDetailModel> getAccessionRegisterDetail(JsonNode query); @Override Status importIngestContracts(List<IngestContractModel> ingestContractModelList); @Override Status importAccessContracts(List<AccessContractModel> accessContractModelList); @Override Status importManagementContracts(List<ManagementContractModel> accessContractModelList); @Override RequestResponse findAccessContracts(JsonNode queryDsl); @Override RequestResponse findAccessContractsByID(String documentId); @Override RequestResponse<IngestContractModel> findIngestContracts(JsonNode query); @Override RequestResponse<IngestContractModel> findIngestContractsByID(String id); @Override RequestResponse findManagementContracts(JsonNode queryDsl); @Override RequestResponse findManagementContractsByID(String documentId); @Override RequestResponse createProfiles(List<ProfileModel> profileModelList); @Override RequestResponse importProfileFile(String profileMetadataId, InputStream stream); @Override Response downloadProfileFile(String profileMetadataId); @Override RequestResponse<ProfileModel> findProfiles(JsonNode query); @Override RequestResponse<ProfileModel> findProfilesByID(String id); @Override RequestResponse createArchiveUnitProfiles(List<ArchiveUnitProfileModel> archiveUnitProfileModelList); @Override RequestResponse<ArchiveUnitProfileModel> findArchiveUnitProfiles(JsonNode query); @Override RequestResponse<ArchiveUnitProfileModel> findArchiveUnitProfilesByID(String requestedId); @Override RequestResponse<ArchiveUnitProfileModel> updateArchiveUnitProfile(String id, JsonNode queryDsl); @Override RequestResponse<AccessContractModel> updateAccessContract(String id, JsonNode queryDsl); @Override RequestResponse<IngestContractModel> updateIngestContract(String id, JsonNode queryDsl); @Override RequestResponse<ManagementContractModel> updateManagementContract(String id, JsonNode queryDsl); @Override Status importContexts(List<ContextModel> contextModelList); @Override RequestResponse<ContextModel> updateContext(String id, JsonNode queryDsl); @Override RequestResponse<ContextModel> findContexts(JsonNode queryDsl); @Override RequestResponse<ContextModel> findContextById(String id); @Override RequestResponse<Boolean> securityProfileIsUsedInContexts(String securityProfileId); @Override RequestResponse<JsonNode> launchAuditWorkflow(AuditOptions options); @Override RequestResponse<JsonNode> launchRuleAudit(); @Override Status importSecurityProfiles(List<SecurityProfileModel> securityProfileModelList); @Override RequestResponse findSecurityProfiles(JsonNode queryDsl); @Override RequestResponse findSecurityProfileByIdentifier(String identifier); @Override RequestResponse<SecurityProfileModel> updateSecurityProfile(String identifier, JsonNode queryDsl); @Override RequestResponse<ProfileModel> updateProfile(String id, JsonNode queryDsl); @Override RequestResponse<IndexationResult> launchReindexation(JsonNode options); @Override RequestResponse<IndexationResult> switchIndexes(JsonNode options); @Override RequestResponse<JsonNode> evidenceAudit(JsonNode query); @Override RequestResponse<JsonNode> rectificationAudit(String operationId); @Override RequestResponse<JsonNode> exportProbativeValue(ProbativeValueRequest queryDsl); @Override RequestResponse importOntologies(boolean forceUpdate, List<OntologyModel> ontologyModelList); @Override RequestResponse<OntologyModel> findOntologies(JsonNode query); @Override RequestResponse<OntologyModel> findOntologyByID(String requestedId); @Override RequestResponse forcePause(ProcessPause info); @Override RequestResponse removeForcePause(ProcessPause info); @Override RequestResponse<AccessionRegisterSymbolic> createAccessionRegisterSymbolic(Integer tenant); @Override RequestResponse<List<AccessionRegisterSymbolicModel>> getAccessionRegisterSymbolic(Integer tenant,
        JsonNode queryDsl); @Override RequestResponse importGriffins(List<GriffinModel> griffinModelList); @Override RequestResponse importPreservationScenarios(List<PreservationScenarioModel> preservationScenarioModelList); @Override RequestResponse<GriffinModel> findGriffinByID(String id); @Override RequestResponse<PreservationScenarioModel> findPreservationByID(String id); @Override RequestResponse<PreservationScenarioModel> findPreservation(JsonNode dslQuery); @Override RequestResponse findGriffin(JsonNode dslQuery); @Override Status createExternalOperation(LogbookOperationParameters logbookOperationparams); }
AdminManagementClientMock extends AbstractMockClient implements AdminManagementClient { @Override public RequestResponse findAccessContracts(JsonNode queryDsl) throws InvalidParseOperationException, AdminManagementClientServerException { LOGGER.debug("find access contracts request "); if (VitamThreadUtils.getVitamSession().getTenantId() == null) { VitamThreadUtils.getVitamSession().setTenantId(0); } AccessContractModel model = JsonHandler.getFromString(ClientMockResultHelper.ACCESS_CONTRACTS, AccessContractModel.class); return ClientMockResultHelper.createResponse(model); }  @Override Response checkFormat(InputStream stream); @Override Status importFormat(InputStream stream, String filename); @Override JsonNode getFormatByID(String id); @Override RequestResponse<FileFormatModel> getFormats(JsonNode query); @Override Response checkRulesFile(InputStream stream); @Override Response checkAgenciesFile(InputStream stream); @Override Status importRulesFile(InputStream stream, String filename); @Override Status importAgenciesFile(InputStream stream, String filename); @Override JsonNode getAgencies(JsonNode query); @Override JsonNode getRuleByID(String id); @Override RequestResponse<AgenciesModel> getAgencyById(String id); @Override JsonNode getRules(JsonNode query); @Override RequestResponse createOrUpdateAccessionRegister(AccessionRegisterDetailModel register); @Override RequestResponse getAccessionRegister(JsonNode query); @Override RequestResponse getAccessionRegisterDetail(String originatingAgency, JsonNode query); @Override RequestResponse<AccessionRegisterDetailModel> getAccessionRegisterDetail(JsonNode query); @Override Status importIngestContracts(List<IngestContractModel> ingestContractModelList); @Override Status importAccessContracts(List<AccessContractModel> accessContractModelList); @Override Status importManagementContracts(List<ManagementContractModel> accessContractModelList); @Override RequestResponse findAccessContracts(JsonNode queryDsl); @Override RequestResponse findAccessContractsByID(String documentId); @Override RequestResponse<IngestContractModel> findIngestContracts(JsonNode query); @Override RequestResponse<IngestContractModel> findIngestContractsByID(String id); @Override RequestResponse findManagementContracts(JsonNode queryDsl); @Override RequestResponse findManagementContractsByID(String documentId); @Override RequestResponse createProfiles(List<ProfileModel> profileModelList); @Override RequestResponse importProfileFile(String profileMetadataId, InputStream stream); @Override Response downloadProfileFile(String profileMetadataId); @Override RequestResponse<ProfileModel> findProfiles(JsonNode query); @Override RequestResponse<ProfileModel> findProfilesByID(String id); @Override RequestResponse createArchiveUnitProfiles(List<ArchiveUnitProfileModel> archiveUnitProfileModelList); @Override RequestResponse<ArchiveUnitProfileModel> findArchiveUnitProfiles(JsonNode query); @Override RequestResponse<ArchiveUnitProfileModel> findArchiveUnitProfilesByID(String requestedId); @Override RequestResponse<ArchiveUnitProfileModel> updateArchiveUnitProfile(String id, JsonNode queryDsl); @Override RequestResponse<AccessContractModel> updateAccessContract(String id, JsonNode queryDsl); @Override RequestResponse<IngestContractModel> updateIngestContract(String id, JsonNode queryDsl); @Override RequestResponse<ManagementContractModel> updateManagementContract(String id, JsonNode queryDsl); @Override Status importContexts(List<ContextModel> contextModelList); @Override RequestResponse<ContextModel> updateContext(String id, JsonNode queryDsl); @Override RequestResponse<ContextModel> findContexts(JsonNode queryDsl); @Override RequestResponse<ContextModel> findContextById(String id); @Override RequestResponse<Boolean> securityProfileIsUsedInContexts(String securityProfileId); @Override RequestResponse<JsonNode> launchAuditWorkflow(AuditOptions options); @Override RequestResponse<JsonNode> launchRuleAudit(); @Override Status importSecurityProfiles(List<SecurityProfileModel> securityProfileModelList); @Override RequestResponse findSecurityProfiles(JsonNode queryDsl); @Override RequestResponse findSecurityProfileByIdentifier(String identifier); @Override RequestResponse<SecurityProfileModel> updateSecurityProfile(String identifier, JsonNode queryDsl); @Override RequestResponse<ProfileModel> updateProfile(String id, JsonNode queryDsl); @Override RequestResponse<IndexationResult> launchReindexation(JsonNode options); @Override RequestResponse<IndexationResult> switchIndexes(JsonNode options); @Override RequestResponse<JsonNode> evidenceAudit(JsonNode query); @Override RequestResponse<JsonNode> rectificationAudit(String operationId); @Override RequestResponse<JsonNode> exportProbativeValue(ProbativeValueRequest queryDsl); @Override RequestResponse importOntologies(boolean forceUpdate, List<OntologyModel> ontologyModelList); @Override RequestResponse<OntologyModel> findOntologies(JsonNode query); @Override RequestResponse<OntologyModel> findOntologyByID(String requestedId); @Override RequestResponse forcePause(ProcessPause info); @Override RequestResponse removeForcePause(ProcessPause info); @Override RequestResponse<AccessionRegisterSymbolic> createAccessionRegisterSymbolic(Integer tenant); @Override RequestResponse<List<AccessionRegisterSymbolicModel>> getAccessionRegisterSymbolic(Integer tenant,
        JsonNode queryDsl); @Override RequestResponse importGriffins(List<GriffinModel> griffinModelList); @Override RequestResponse importPreservationScenarios(List<PreservationScenarioModel> preservationScenarioModelList); @Override RequestResponse<GriffinModel> findGriffinByID(String id); @Override RequestResponse<PreservationScenarioModel> findPreservationByID(String id); @Override RequestResponse<PreservationScenarioModel> findPreservation(JsonNode dslQuery); @Override RequestResponse findGriffin(JsonNode dslQuery); @Override Status createExternalOperation(LogbookOperationParameters logbookOperationparams);  }