GitHubHelper { public static LicenseInformation getLicenseInformation(GitHub gitHub, String repositoryName) { try { GHRepository repository = gitHub.getRepository(repositoryName); GHLicense license = repository.getLicense(); if (license == null) { return new LicenseInformation(); } LicenseInformation licenseInformation = new LicenseInformation(); licenseInformation.setLicenseName(license.getName()); return licenseInformation; } catch (IOException e) { LOG.info("Could not get license information from GitHub for repository: " + repositoryName, e); return new LicenseInformation(); } } private  GitHubHelper(); static String getGitHubAccessToken(String code, String githubClientID, String githubClientSecret); static LicenseInformation getLicenseInformation(GitHub gitHub, String repositoryName); static String makeGitHubAppRequestAndGetRepositorySelection(Request request); static Set<String> getOrganizationsWithGitHubApp(Set<String> organizations); static Set<String> getReposWithGitHubApp(Set<String> repos); static String orgFromRepo(String repositoryName); static Set<String> individualReposWithGitHubApp(Collection<String> allRepositories, Collection<String> orgsWithAppInstalled); static void checkJWT(String gitHubAppId, String gitHubPrivateKeyFile); static String gitHubAppSetup(String gitHubAppId, String gitHubPrivateKeyFile, String installationId); static Collection<String> reposToCreateEntitiesFor(Collection<String> repositories, Optional<String> organization,
            Set<String> existingWorkflowPaths); static User findUserByGitHubUsername(TokenDAO tokenDAO, UserDAO userDAO, String username, boolean allowFail);  }
@Test public void testGitHubLicense() throws IOException { GitHub gitHub = new GitHubBuilder().withRateLimitHandler(RateLimitHandler.WAIT).withAbuseLimitHandler( AbuseLimitHandler.WAIT).build(); LicenseInformation licenseInformation = GitHubHelper.getLicenseInformation(gitHub, "dockstore-testing/md5sum-checker"); Assert.assertEquals("Apache License 2.0", licenseInformation.getLicenseName()); licenseInformation = GitHubHelper.getLicenseInformation(gitHub, "dockstore-testing/galaxy-workflows"); Assert.assertEquals("MIT License", licenseInformation.getLicenseName()); licenseInformation = GitHubHelper.getLicenseInformation(gitHub, "dockstoretestuser2/cwl-gene-prioritization"); Assert.assertEquals("Other", licenseInformation.getLicenseName()); licenseInformation = GitHubHelper.getLicenseInformation(gitHub, "dockstore-testing/silly-example"); Assert.assertNull(licenseInformation.getLicenseName()); }