DPSArchive extends BaseArchive { @SuppressWarnings("unchecked") public String submitToArchive(String targetInstanceOID, String SIP, Map xAttributes, List<ArchiveFile> fileList) throws DPSUploadException { String IID = null; try { if (targetInstanceOID != null) { for(ArchiveFile f : fileList){ f.setMd5(calculateMD5(f.getFile())); } String finalSIP = getFinalSIP(SIP, targetInstanceOID, fileList); DpsDepositProxy dpsDeposit = getDpsDepositFacade(); List<File> files = extractFileDetailsFrom(fileList); Map<String, String> parameters = populateDepositParameterFromFields(xAttributes, finalSIP, targetInstanceOID); dpsDeposit.setCustomDepositFormMapping(customDepositFormMapping); DepositResult depositResult = dpsDeposit.deposit(parameters, files); if (depositResult.isError()) throw new DPSUploadException("Submission to DPS failed for Target Instance " + targetInstanceOID + ", message from DPS: " + depositResult.getMessageDesciption()); IID = DPS_SIPID_PREFIX + Long.toString(depositResult.getSipId()); } return IID; } catch (Exception ex) { log.error("Error submitting to DPS", ex); throw new DPSUploadException(ex); } }  @SuppressWarnings("unchecked") String submitToArchive(String targetInstanceOID, String SIP, Map xAttributes, List<ArchiveFile> fileList); CustomDepositFormResultDTO getCustomDepositFormDetails(CustomDepositFormCriteriaDTO criteria); boolean validateProducerAgentName(String producerAgent); boolean isLoginSuccessful(String producerAgent, String agentPassword); DepData[] getProducer(String producerAgentUserId, boolean fromCache); DepData getProducer(String producerAgentUserId, String producerId); DepData[] getMaterialFlows(String producerID); boolean validateMaterialFlowAssociation(String producerId, String targetDcType); void setPdsUrl(String pdsUrl); void setFtpHost(String ftpHost); void setFtpUserName(String ftpUserName); void setFtpPassword(String ftpPassword); void setFtpDirectory(String ftpDirectory); void setDepositServerBaseUrl(String depositServerBaseUrl); void setDpsUserInstitution(String dpsUserInstitution); void setDpsUserName(String dpsUserName); void setDpsUserPassword(String dpsUserPassword); void setMaterialFlowId(String materialFlowId); void setProducerId(String producerId); void setProducerWsdlRelativePath(String producerWsdlRelativePath); void setDepositWsdlRelativePath(String depositWsdlRelativePath); void setAgenciesResponsibleForHtmlSerials(String agenciesResponsibleForHtmlSerials); void setTargetDCTypesOfHtmlSerials(String targetDCTypesOfHtmlSerials); void setMaterialFlowsOfHtmlSerials(String materialFlowsOfHtmlSerials); void setProducerIdsOfHtmlSerials(String producerIdsOfHtmlSerials); void setIeEntityTypesOfHtmlSerials(String ieEntityTypesOfHtmlSerials); void setCustomDepositFormURLsForHtmlSerialIngest(String customDepositFormURLsForHtmlSerialIngest); void setRestrictHTMLSerialAgenciesToHTMLSerialTypes(String restrictHTMLSerialAgenciesToHTMLSerialTypes); void setTargetDCTypesOfCustomWebHarvest(String targetDCTypesOfCustomWebHarvest); void setMaterialFlowsOfCustomWebHarvest(String materialFlowsOfCustomWebHarvest); void setProducerIdsOfCustomWebHarvest(String producerIdsOfCustomWebHarvest); void setIeEntityTypesOfCustomWebHarvest(String ieEntityTypesOfCustomWebHarvest); void setDCTitleSourceOfCustomWebHarvest(String DCTitleSourceOfCustomWebHarvest); void setOmsOpenAccess(String omsOpenAccess); void setOmsPublishedRestricted(String omsPublishedRestricted); void setOmsUnpublishedRestrictedByLocation(String omsUnpublishedRestrictedByLocation); void setOmsUnpublishedRestrictedByPersion(String omsUnpublishedRestrictedByPersion); void setCmsSection(String cmsSection); void setCmsSystem(String cmsSystem); void setCustomDepositFormMapping(CustomDepositFormMapping customDepositFormMapping);  }
@Test public void testSubmitToArchive() throws DPSUploadException { mockDpsDepositFacade = mockDpsDepositFacade(); DPSArchive archiver = new UnitTestDPSArchive(); setVariousParameters(archiver); Map<String, String> attributes = mockDasAttributeMap(); String finalSIP = "someFinalSIPXml"; String targetInstanceOID = "112233"; final List<ArchiveFile> archiveFileList = mockDasArchiveFileList(); String archiveId = archiver.submitToArchive(targetInstanceOID, finalSIP, attributes, archiveFileList); assertEquals("dps-sipid-" + expectedSipId, archiveId); }