Source:
public void testManualRefreshWorkflowWithGitHubApp() throws Exception { CommonTestUtilities.cleanStatePrivate2(SUPPORT, false); final ApiClient webClient = getWebClient(BasicIT.USER_2_USERNAME, testingPostgres); WorkflowsApi client = new WorkflowsApi(webClient); List<Workflow> workflows = client.handleGitHubRelease(workflowRepo, "DockstoreTestUser2", "refs/tags/0.1", installationId); assertEquals("Should only have one service", 1, workflows.size()); Workflow workflow = client.getWorkflowByPath("github.com/" + workflowRepo + "/foobar", "", false); assertEquals("Should be a WDL workflow", Workflow.DescriptorTypeEnum.WDL, workflow.getDescriptorType()); assertEquals("Should be type DOCKSTORE_YML", Workflow.ModeEnum.DOCKSTORE_YML, workflow.getMode()); assertEquals("Should have one version 0.1", 1, workflow.getWorkflowVersions().size()); workflow = client.refresh(workflow.getId()); assertNotNull(workflow); assertEquals("Should have four workflow versions: 0.1, 0.2 and 0.3, and master", 4, workflow.getWorkflowVersions().size()); Optional<WorkflowVersion> versionTwo = workflow.getWorkflowVersions().stream().filter(workflowVersion -> Objects.equals(workflowVersion.getReference(), "0.2")).findFirst(); Optional<WorkflowVersion> versionThree = workflow.getWorkflowVersions().stream().filter(workflowVersion -> Objects.equals(workflowVersion.getReference(), "0.3")).findFirst(); Optional<WorkflowVersion> versionMaster = workflow.getWorkflowVersions().stream().filter(workflowVersion -> Objects.equals(workflowVersion.getReference(), "master")).findFirst(); assertTrue("Version 0.2 should exist", versionTwo.isPresent()); assertEquals("", "/Dockstore.wdl", versionTwo.get().getWorkflowPath()); assertTrue("Version 0.3 should exist", versionThree.isPresent()); assertEquals("", "/Dockstore2.wdl", versionThree.get().getWorkflowPath()); assertTrue("Version master should exist", versionMaster.isPresent()); assertEquals("", "/Dockstore2.wdl", versionMaster.get().getWorkflowPath()); }

Target:
public void testManualRefreshWorkflowWithGitHubApp() throws Exception { CommonTestUtilities.cleanStatePrivate2(SUPPORT, false); final ApiClient webClient = getWebClient(BasicIT.USER_2_USERNAME, testingPostgres); WorkflowsApi client = new WorkflowsApi(webClient); List<Workflow> workflows = client.handleGitHubRelease(workflowRepo, "DockstoreTestUser2", "refs/tags/0.1", installationId); assertEquals("Should only have one service", 1, workflows.size()); Workflow workflow = client.getWorkflowByPath("github.com/" + workflowRepo + "/foobar", "", false); assertEquals("Should be a WDL workflow", Workflow.DescriptorTypeEnum.WDL, workflow.getDescriptorType()); assertEquals("Should be type DOCKSTORE_YML", Workflow.ModeEnum.DOCKSTORE_YML, workflow.getMode()); assertTrue("Should have a 0.1 version.", workflow.getWorkflowVersions().stream().anyMatch((WorkflowVersion version) -> Objects.equals(version.getName(), "0.1"))); workflow = client.refresh(workflow.getId()); assertNotNull(workflow); Optional<WorkflowVersion> versionOne = workflow.getWorkflowVersions().stream().filter(workflowVersion -> Objects.equals(workflowVersion.getReference(), "0.1")).findFirst(); Optional<WorkflowVersion> versionTwo = workflow.getWorkflowVersions().stream().filter(workflowVersion -> Objects.equals(workflowVersion.getReference(), "0.2")).findFirst(); Optional<WorkflowVersion> versionThree = workflow.getWorkflowVersions().stream().filter(workflowVersion -> Objects.equals(workflowVersion.getReference(), "0.3")).findFirst(); Optional<WorkflowVersion> versionMaster = workflow.getWorkflowVersions().stream().filter(workflowVersion -> Objects.equals(workflowVersion.getReference(), "master")).findFirst(); assertTrue("Version 0.1 should exist", versionOne.isPresent()); assertEquals("", "/Dockstore.wdl", versionOne.get().getWorkflowPath()); assertTrue("Version 0.2 should exist", versionTwo.isPresent()); assertEquals("", "/Dockstore.wdl", versionTwo.get().getWorkflowPath()); assertTrue("Version 0.3 should exist", versionThree.isPresent()); assertEquals("", "/Dockstore2.wdl", versionThree.get().getWorkflowPath()); assertTrue("Version master should exist", versionMaster.isPresent()); assertEquals("", "/Dockstore2.wdl", versionMaster.get().getWorkflowPath()); }