Source:
public void testGitHubAppEndpoints() throws Exception { final CommonTestUtilities.TestingPostgres testingPostgres = getTestingPostgres(); CommonTestUtilities.cleanStatePrivate2(SUPPORT, false); final ApiClient webClient = getWebClient("admin@admin.com"); WorkflowsApi client = new WorkflowsApi(webClient); String serviceRepo = "DockstoreTestUser2/test-service"; String installationId = "1179416"; io.swagger.client.model.Workflow service = client.addService(serviceRepo, "admin@admin.com", installationId); assertNotNull(service); service = client.upsertServiceVersion(serviceRepo, "DockstoreTestUser2", "1.0", installationId); assertNotNull(service); assertEquals("Should have a new version", 1, service.getWorkflowVersions().size()); assertEquals("Should have 3 source files", 3, service.getWorkflowVersions().get(0).getSourceFiles().size()); assertEquals("Should have 2 users", 2, service.getUsers().size()); final long count = testingPostgres .runSelectStatement("select count(*) from service where sourcecontrol = 'github.com' and organization = 'DockstoreTestUser2' and repository = 'test-service'", new ScalarHandler<>()); Assert.assertEquals("there should be one matching service", 1, count); UsersApi usersApi = new UsersApi(webClient); List<io.swagger.client.model.Workflow> services = usersApi.userServices(service.getUsers().get(0).getId()); List<io.swagger.client.model.Workflow> workflows = usersApi.userWorkflows(service.getUsers().get(0).getId()); assertTrue("There should be one service", services.size() == 1); assertTrue("There should be no workflows", workflows.size() == 0); }

Target:
public void testGitHubAppEndpoints() throws Exception { final CommonTestUtilities.TestingPostgres testingPostgres = getTestingPostgres(); CommonTestUtilities.cleanStatePrivate2(SUPPORT, false); final ApiClient webClient = getWebClient("admin@admin.com"); WorkflowsApi client = new WorkflowsApi(webClient); String serviceRepo = "DockstoreTestUser2/test-service"; String installationId = "1179416"; io.swagger.client.model.Workflow service = client.addService(serviceRepo, "admin@admin.com", installationId); assertNotNull(service); service = client.upsertServiceVersion(serviceRepo, "DockstoreTestUser2", "1.0", installationId); assertNotNull(service); assertEquals("Should have a new version", 1, service.getWorkflowVersions().size()); assertEquals("Should have 3 source files", 3, service.getWorkflowVersions().get(0).getSourceFiles().size()); assertEquals("Should have 2 users", 2, service.getUsers().size()); final long count = testingPostgres .runSelectStatement("select count(*) from service where sourcecontrol = 'github.com' and organization = 'DockstoreTestUser2' and repository = 'test-service'", new ScalarHandler<>()); Assert.assertEquals("there should be one matching service", 1, count); UsersApi usersApi = new UsersApi(webClient); List<io.swagger.client.model.Workflow> services = usersApi.userServices(service.getUsers().get(0).getId()); List<io.swagger.client.model.Workflow> workflows = usersApi.userWorkflows(service.getUsers().get(0).getId()); assertEquals("There should be one service", 1, services.size()); assertEquals("There should be no workflows", 0, workflows.size()); }