Source:
<code>public void testGenerateDOIFrozenVersion() throws ApiException { ApiClient webClient = WorkflowIT.getWebClient(USER_2_USERNAME, testingPostgres); WorkflowsApi workflowApi = new WorkflowsApi(webClient); UsersApi usersApi = new UsersApi(webClient); final Long userId = usersApi.getUser().getId(); usersApi.refreshWorkflows(userId); Workflow githubWorkflow = workflowApi .manualRegister("github", "DockstoreTestUser2/test_lastmodified", "/hello.wdl", "test-update-workflow", "wdl", "/test.json"); workflowApi.refresh(githubWorkflow.getId()); Workflow workflowBeforeFreezing = workflowApi.refresh(githubWorkflow.getId()); WorkflowVersion master = workflowBeforeFreezing.getWorkflowVersions().stream().filter(v -> v.getName().equals("master")).findFirst().get(); try { workflowApi.requestDOIForWorkflowVersion(workflowBeforeFreezing.getId(), master.getId(), ""); fail("This line should never execute if version is mutable. DOI should only be generated for frozen versions of workflows."); } catch (ApiException ex) { assertFalse("Version should not be frozen", master.isFrozen()); assertNull("version DOI is null", master.getDoiURL()); } master.setFrozen(true); final List<WorkflowVersion> workflowVersions1 = workflowApi <START> .updateWorkflowVersion(workflowBeforeFreezing.getId(), Lists.newArrayList(master)); <END> master = workflowVersions1.stream().filter(v -> v.getName().equals("master")).findFirst().get(); assertTrue(master.isFrozen()); try { workflowApi.requestDOIForWorkflowVersion(workflowBeforeFreezing.getId(), master.getId(), ""); fail("This line should never execute without valid Zenodo token"); } catch (ApiException ex) { } }</code><technical_language>verify exception is expect. Line 1203 is fail. do failed Zenodo token vs. of frozen check? need ensure failing for right reason</technical_language>

Target:
public void testGenerateDOIFrozenVersion() throws ApiException { ApiClient webClient = WorkflowIT.getWebClient(USER_2_USERNAME, testingPostgres); WorkflowsApi workflowApi = new WorkflowsApi(webClient); Workflow githubWorkflow = workflowApi .manualRegister("github", "DockstoreTestUser2/test_lastmodified", "/hello.wdl", "test-update-workflow", "wdl", "/test.json"); Workflow workflowBeforeFreezing = workflowApi.refresh(githubWorkflow.getId()); WorkflowVersion master = workflowBeforeFreezing.getWorkflowVersions().stream().filter(v -> v.getName().equals("master")).findFirst().get(); try { workflowApi.requestDOIForWorkflowVersion(workflowBeforeFreezing.getId(), master.getId(), ""); fail("This line should never execute if version is mutable. DOI should only be generated for frozen versions of workflows."); } catch (ApiException ex) { assertTrue(ex.getResponseBody().contains(FROZEN_VERSION_REQUIRED)); } master.setFrozen(true); final List<WorkflowVersion> workflowVersions1 = workflowApi .updateWorkflowVersion(workflowBeforeFreezing.getId(), Lists.newArrayList(master)); master = workflowVersions1.stream().filter(v -> v.getName().equals("master")).findFirst().get(); assertTrue(master.isFrozen()); try { workflowApi.requestDOIForWorkflowVersion(workflowBeforeFreezing.getId(), master.getId(), ""); fail("This line should never execute without valid Zenodo token"); } catch (ApiException ex) { assertTrue(ex.getResponseBody().contains(NO_ZENDO_USER_TOKEN)); } }