Source:
<code>public void testNestedWdlWorkflow() throws ApiException { final ApiClient webClient = getWebClient(); WorkflowsApi workflowApi = new WorkflowsApi(webClient); UsersApi usersApi = new UsersApi(webClient); final Long userId = usersApi.getUser().getId(); final CommonTestUtilities.TestingPostgres testingPostgres = getTestingPostgres(); Workflow githubWorkflow = workflowApi .manualRegister("github", "DockstoreTestUser2/nested-wdl", "/Dockstore.wdl", "altname", "wdl", "/test.json"); final long count = testingPostgres .runSelectStatement("select count(*) from workflow where mode = '" + Workflow.ModeEnum.FULL + "'", new ScalarHandler<>()); <START> assertTrue("No workflows are in full mode", count == 0); <END> workflowApi.refresh(githubWorkflow.getId()); githubWorkflow = workflowApi.getWorkflow(githubWorkflow.getId()); List<WorkflowVersion> versions = githubWorkflow.getWorkflowVersions(); assertEquals("There should be two versions", 2, versions.size()); Optional<WorkflowVersion> loopVersion = versions.stream().filter(version -> Objects.equals(version.getReference(), "infinite-loop")).findFirst(); if (loopVersion.isPresent()) { assertEquals("There should be two sourcefiles", 2, loopVersion.get().getSourceFiles().size()); } else { fail("Could not find version infinite-loop"); } Optional<WorkflowVersion> masterVersion = versions.stream().filter(version -> Objects.equals(version.getReference(), "master")).findFirst(); if (loopVersion.isPresent()) { assertEquals("There should be three sourcefiles", 3, masterVersion.get().getSourceFiles().size()); } else { fail("Could not find version master"); } }</code><technical_language>assertEquals</technical_language>

Target:
public void testNestedWdlWorkflow() throws ApiException { final ApiClient webClient = getWebClient(); WorkflowsApi workflowApi = new WorkflowsApi(webClient); UsersApi usersApi = new UsersApi(webClient); final Long userId = usersApi.getUser().getId(); final CommonTestUtilities.TestingPostgres testingPostgres = getTestingPostgres(); Workflow githubWorkflow = workflowApi .manualRegister("github", "DockstoreTestUser2/nested-wdl", "/Dockstore.wdl", "altname", "wdl", "/test.json"); final long count = testingPostgres .runSelectStatement("select count(*) from workflow where mode = '" + Workflow.ModeEnum.FULL + "'", new ScalarHandler<>()); assertEquals("No workflows are in full mode", 0,count); workflowApi.refresh(githubWorkflow.getId()); githubWorkflow = workflowApi.getWorkflow(githubWorkflow.getId()); List<WorkflowVersion> versions = githubWorkflow.getWorkflowVersions(); assertEquals("There should be two versions", 2, versions.size()); Optional<WorkflowVersion> loopVersion = versions.stream().filter(version -> Objects.equals(version.getReference(), "infinite-loop")).findFirst(); if (loopVersion.isPresent()) { assertEquals("There should be two sourcefiles", 2, loopVersion.get().getSourceFiles().size()); } else { fail("Could not find version infinite-loop"); } Optional<WorkflowVersion> masterVersion = versions.stream().filter(version -> Objects.equals(version.getReference(), "master")).findFirst(); if (masterVersion.isPresent()) { assertEquals("There should be three sourcefiles", 3, masterVersion.get().getSourceFiles().size()); } else { fail("Could not find version master"); } }