Skip to content

Commit

Permalink
test for changes
Browse files Browse the repository at this point in the history
  • Loading branch information
agduncan94 committed Mar 28, 2019
1 parent d90abc8 commit dd4d02d
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ public void testRefreshAllForAUser() throws ApiException {

final ApiClient webClient = getWebClient(USER_2_USERNAME);
UsersApi usersApi = new UsersApi(webClient);
final List<Workflow> workflow = usersApi.refreshWorkflows(userId);
final List<Workflow> workflows = usersApi.refreshWorkflows(userId);

// Check that there are multiple workflows
final long count = testingPostgres.runSelectStatement("select count(*) from workflow", new ScalarHandler<>());
Expand All @@ -658,9 +658,9 @@ public void testRefreshAllForAUser() throws ApiException {
assertEquals("No workflows are in full mode", 0, count3);

// check that a nextflow workflow made it
long nfWorkflowCount = workflow.stream().filter(w -> w.getGitUrl().contains("mta-nf")).count();
long nfWorkflowCount = workflows.stream().filter(w -> w.getGitUrl().contains("mta-nf")).count();
assertTrue("Nextflow workflow not found", nfWorkflowCount > 0);
Workflow mtaNf = workflow.stream().filter(w -> w.getGitUrl().contains("mta-nf")).findFirst().get();
Workflow mtaNf = workflows.stream().filter(w -> w.getGitUrl().contains("mta-nf")).findFirst().get();
WorkflowsApi workflowApi = new WorkflowsApi(webClient);
mtaNf.setWorkflowPath("/nextflow.config");
mtaNf.setDescriptorType(LanguageType.NEXTFLOW.toString());
Expand Down Expand Up @@ -693,6 +693,19 @@ public Boolean isPublish() {
assertTrue("could get mta as part of list", toolV2s.size() > 0 && toolV2s.stream().anyMatch(tool -> Objects
.equals(tool.getId(), mtaWorkflowID)));
assertNotNull("could get mta as a specific tool", toolV2);

// Check that a workflow from my namespace is present
assertTrue("Should have at least one repo from DockstoreTestUser2.", workflows.stream().anyMatch((Workflow workflow) -> workflow.getOrganization().equalsIgnoreCase("DockstoreTestUser2")));

// Check that a workflow from an organization I below to is present
assertTrue("Should have at least one repo from organization dockstoretesting.", workflows.stream().anyMatch((Workflow workflow) -> workflow.getOrganization().equalsIgnoreCase("dockstoretesting")));

// Check that a workflow that I am a collaborator on is present
assertTrue("Should have at least one repo from DockstoreTestUser.", workflows.stream().anyMatch((Workflow workflow) -> workflow.getOrganization().equalsIgnoreCase("DockstoreTestUser")));

// Check that for a repo from my organization that I forked to DockstoreTestUser2, that it along with the original repo are present
assertEquals("Should have two repos with name basic-workflow, one from DockstoreTestUser2 and one from dockstoretesting.", 2, workflows.stream().filter((Workflow workflow) -> workflow.getRepository().equalsIgnoreCase("basic-workflow")).count());

}

/**
Expand Down

0 comments on commit dd4d02d

Please sign in to comment.