ZenodoHelper { protected static String createWorkflowTrsUrl(Workflow workflow, WorkflowVersion workflowVersion, String dockstoreGA4GHBaseUrl) { final String sourceControlPath = workflow.getWorkflowPath(); final String workflowVersionPrimaryDescriptorPath = WORKFLOW_PREFIX + "/" + sourceControlPath; final String workflowVersionPrimaryDescriptorPathPlainText; try { workflowVersionPrimaryDescriptorPathPlainText = ToolsImplCommon.getUrl(workflowVersionPrimaryDescriptorPath, dockstoreGA4GHBaseUrl); } catch (UnsupportedEncodingException e) { LOG.error("Could not create Zenodo related identifier." + " Error is " + e.getMessage(), e); throw new CustomWebApplicationException("Could not create Zenodo related identifier", HttpStatus.SC_INTERNAL_SERVER_ERROR); } final String workflowVersionType = workflow.getDescriptorType().toString(); final String workflowDescriptorName = workflowVersion.getWorkflowPath(); Path p = Paths.get(workflowDescriptorName); final String descriptorFile = p.getFileName().toString(); final String versionOfWorkflow = workflowVersion.getName(); return workflowVersionPrimaryDescriptorPathPlainText + "/versions/" + versionOfWorkflow + "/PLAIN-" + workflowVersionType + "/descriptor/" + descriptorFile; } private  ZenodoHelper(); static ZenodoDoiResult registerZenodoDOI(ApiClient zenodoClient, Workflow workflow,
            WorkflowVersion workflowVersion, String workflowUrl, String dockstoreGA4GHBaseUrl,
            String dockstoreUrl, EntryVersionHelper entryVersionHelper);  }
@Test public void testcreateWorkflowTrsUrl() { final Workflow workflow = new BioWorkflow(); final WorkflowVersion workflowVersion = new WorkflowVersion(); workflow.setSourceControl(SourceControl.GITHUB); workflow.setOrganization("DataBiosphere"); workflow.setRepository("topmed-workflows"); workflow.setWorkflowName("UM_variant_caller_wdl"); workflow.setDescriptorType(DescriptorLanguage.WDL); workflowVersion.setWorkflowPath("topmed_freeze3_calling.wdl"); workflowVersion.setName("1.32.0"); String trsUrl = ZenodoHelper.createWorkflowTrsUrl(workflow, workflowVersion, "https: Assert.assertEquals("https: + "%2Ftopmed-workflows%2FUM_variant_caller_wdl/versions/1.32.0/PLAIN-WDL/descriptor/topmed_freeze3_calling.wdl", trsUrl); }