test_class.file: dockerfile-image-update/src/test/java/com/salesforce/dockerfileimageupdate/utils/GitHubUtilTest.java
test_class.identifier: GitHubUtilTest
test_case.body: @Test
      public void testGetReposForUserAtCurrentInstant() throws Exception {
          GHMyself currentUser = mock(GHMyself.class);
          PagedIterable<GHRepository> listOfRepos = mock(PagedIterable.class);
  
          GHRepository repo1 = mock(GHRepository.class);
          when(repo1.getName()).thenReturn("test1");
          GHRepository repo2 = mock(GHRepository.class);
          when(repo2.getName()).thenReturn("test2");
          GHRepository repo3 = mock(GHRepository.class);
          when(repo3.getName()).thenReturn("test3");
          GHRepository repo4 = mock(GHRepository.class);
          when(repo4.getName()).thenReturn("test4");
  
          PagedIterator<GHRepository> listOfReposIterator = mock(PagedIterator.class);
          when(listOfReposIterator.hasNext()).thenReturn(true, true, true, true, false);
          when(listOfReposIterator.next()).thenReturn(repo1, repo2, repo3, repo4, null);
          when(listOfRepos.iterator()).thenReturn(listOfReposIterator);
  
          when(currentUser.listRepositories(100, GHMyself.RepositoryListFilter.OWNER)).thenReturn(listOfRepos);
  
          GitHub github = mock(GitHub.class);
          GitHubUtil gitHubUtil = new GitHubUtil(github);
          Map<String, GHRepository> repoByName = gitHubUtil.getReposForUserAtCurrentInstant(currentUser);
          assertEquals(repoByName.size(), 4);
          assertTrue(repoByName.containsKey("test1") && repoByName.get("test1") == repo1);
          assertTrue(repoByName.containsKey("test2") && repoByName.get("test2") == repo2);
          assertTrue(repoByName.containsKey("test3") && repoByName.get("test3") == repo3);
          assertTrue(repoByName.containsKey("test4") && repoByName.get("test4") == repo4);
      }
test_case.class_method_signature: GitHubUtilTest.testGetReposForUserAtCurrentInstant()
test_case.full_signature: @Test public void testGetReposForUserAtCurrentInstant()
test_case.identifier: testGetReposForUserAtCurrentInstant
test_case.invocations: mock mock mock thenReturn when getName mock thenReturn when getName mock thenReturn when getName mock thenReturn when getName mock thenReturn when hasNext thenReturn when next thenReturn when iterator thenReturn when listRepositories mock getReposForUserAtCurrentInstant assertEquals size assertTrue containsKey get assertTrue containsKey get assertTrue containsKey get assertTrue containsKey get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetReposForUserAtCurrentInstant()
focal_class.declarator: log = LoggerFactory.getLogger(GitHubUtil.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(GitHubUtil.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: NO_BRANCH_WARN_FORMAT = "Couldn't find branch `%s` in repo `%s`. Waiting a second..."
focal_class.modifier: public static final
focal_class.original_string: public static final String NO_BRANCH_WARN_FORMAT = "Couldn't find branch `%s` in repo `%s`. Waiting a second...";
focal_class.type: String
focal_class.var_name: NO_BRANCH_WARN_FORMAT
focal_class.declarator: github
focal_class.modifier: private final
focal_class.original_string: private final GitHub github;
focal_class.type: GitHub
focal_class.var_name: github
focal_class.file: dockerfile-image-update/src/main/java/com/salesforce/dockerfileimageupdate/utils/GitHubUtil.java
focal_class.identifier: GitHubUtil
focal_class.class_method_signature: GitHubUtil.GitHubUtil(GitHub gitHub)
focal_class.full_signature: public  GitHubUtil(GitHub gitHub)
focal_class.identifier: GitHubUtil
focal_class.modifiers: public
focal_class.parameters: (GitHub gitHub)
focal_class.signature:  GitHubUtil(GitHub gitHub)
focal_class.class_method_signature: GitHubUtil.getGithub()
focal_class.full_signature: public GitHub getGithub()
focal_class.identifier: getGithub
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: GitHub
focal_class.signature: GitHub getGithub()
focal_class.class_method_signature: GitHubUtil.getRepo(String repo)
focal_class.full_signature: public GHRepository getRepo(String repo)
focal_class.identifier: getRepo
focal_class.modifiers: public
focal_class.parameters: (String repo)
focal_class.return: GHRepository
focal_class.signature: GHRepository getRepo(String repo)
focal_class.class_method_signature: GitHubUtil.createPublicRepo(String repoName)
focal_class.full_signature: public GHRepository createPublicRepo(String repoName)
focal_class.identifier: createPublicRepo
focal_class.modifiers: public
focal_class.parameters: (String repoName)
focal_class.return: GHRepository
focal_class.signature: GHRepository createPublicRepo(String repoName)
focal_class.class_method_signature: GitHubUtil.getMyself()
focal_class.full_signature: public GHMyself getMyself()
focal_class.identifier: getMyself
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: GHMyself
focal_class.signature: GHMyself getMyself()
focal_class.class_method_signature: GitHubUtil.startSearch()
focal_class.full_signature: public GHContentSearchBuilder startSearch()
focal_class.identifier: startSearch
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: GHContentSearchBuilder
focal_class.signature: GHContentSearchBuilder startSearch()
focal_class.class_method_signature: GitHubUtil.createFork(GHRepository repo)
focal_class.full_signature: public GHRepository createFork(GHRepository repo)
focal_class.identifier: createFork
focal_class.modifiers: public
focal_class.parameters: (GHRepository repo)
focal_class.return: GHRepository
focal_class.signature: GHRepository createFork(GHRepository repo)
focal_class.class_method_signature: GitHubUtil.safeDeleteRepo(GHRepository repo)
focal_class.full_signature: public void safeDeleteRepo(GHRepository repo)
focal_class.identifier: safeDeleteRepo
focal_class.modifiers: public
focal_class.parameters: (GHRepository repo)
focal_class.return: void
focal_class.signature: void safeDeleteRepo(GHRepository repo)
focal_class.class_method_signature: GitHubUtil.createPullReq(GHRepository origRepo, String branch,
                                   GHRepository forkRepo, String title, String body)
focal_class.full_signature: public int createPullReq(GHRepository origRepo, String branch,
                                   GHRepository forkRepo, String title, String body)
focal_class.identifier: createPullReq
focal_class.modifiers: public
focal_class.parameters: (GHRepository origRepo, String branch,
                                   GHRepository forkRepo, String title, String body)
focal_class.return: int
focal_class.signature: int createPullReq(GHRepository origRepo, String branch,
                                   GHRepository forkRepo, String title, String body)
focal_class.class_method_signature: GitHubUtil.tryRetrievingBranch(GHRepository repo, String branchName)
focal_class.full_signature: protected GHBranch tryRetrievingBranch(GHRepository repo, String branchName)
focal_class.identifier: tryRetrievingBranch
focal_class.modifiers: protected
focal_class.parameters: (GHRepository repo, String branchName)
focal_class.return: GHBranch
focal_class.signature: GHBranch tryRetrievingBranch(GHRepository repo, String branchName)
focal_class.class_method_signature: GitHubUtil.tryRetrievingRepository(String repoName)
focal_class.full_signature: public GHRepository tryRetrievingRepository(String repoName)
focal_class.identifier: tryRetrievingRepository
focal_class.modifiers: public
focal_class.parameters: (String repoName)
focal_class.return: GHRepository
focal_class.signature: GHRepository tryRetrievingRepository(String repoName)
focal_class.class_method_signature: GitHubUtil.tryRetrievingContent(GHRepository repo, String path, String branch)
focal_class.full_signature: public GHContent tryRetrievingContent(GHRepository repo, String path, String branch)
focal_class.identifier: tryRetrievingContent
focal_class.modifiers: public
focal_class.parameters: (GHRepository repo, String path, String branch)
focal_class.return: GHContent
focal_class.signature: GHContent tryRetrievingContent(GHRepository repo, String path, String branch)
focal_class.class_method_signature: GitHubUtil.getGHRepositories(Multimap<String, String> pathToDockerfileInParentRepo,
                                                   GHMyself currentUser)
focal_class.full_signature: public List<GHRepository> getGHRepositories(Multimap<String, String> pathToDockerfileInParentRepo,
                                                   GHMyself currentUser)
focal_class.identifier: getGHRepositories
focal_class.modifiers: public
focal_class.parameters: (Multimap<String, String> pathToDockerfileInParentRepo,
                                                   GHMyself currentUser)
focal_class.return: List<GHRepository>
focal_class.signature: List<GHRepository> getGHRepositories(Multimap<String, String> pathToDockerfileInParentRepo,
                                                   GHMyself currentUser)
focal_class.class_method_signature: GitHubUtil.waitFor(long millis)
focal_class.full_signature: protected void waitFor(long millis)
focal_class.identifier: waitFor
focal_class.modifiers: protected
focal_class.parameters: (long millis)
focal_class.return: void
focal_class.signature: void waitFor(long millis)
focal_class.class_method_signature: GitHubUtil.repoHasBranch(GHRepository repo, String branchName)
focal_class.full_signature: public boolean repoHasBranch(GHRepository repo, String branchName)
focal_class.identifier: repoHasBranch
focal_class.modifiers: public
focal_class.parameters: (GHRepository repo, String branchName)
focal_class.return: boolean
focal_class.signature: boolean repoHasBranch(GHRepository repo, String branchName)
focal_class.class_method_signature: GitHubUtil.getReposForUserAtCurrentInstant(GHMyself user)
focal_class.full_signature: public Map<String, GHRepository> getReposForUserAtCurrentInstant(GHMyself user)
focal_class.identifier: getReposForUserAtCurrentInstant
focal_class.modifiers: public
focal_class.parameters: (GHMyself user)
focal_class.return: Map<String, GHRepository>
focal_class.signature: Map<String, GHRepository> getReposForUserAtCurrentInstant(GHMyself user)
focal_method.body: public Map<String, GHRepository> getReposForUserAtCurrentInstant(GHMyself user) {
          Map<String, GHRepository> repoByName = new HashMap<>();
          if (user == null) {
              return repoByName;
          }
          PagedIterable<GHRepository> reposIterator = user.listRepositories(100, GHMyself.RepositoryListFilter.OWNER);
          for (GHRepository repo: reposIterator) {
              repoByName.put(repo.getName(), repo);
          }
          return repoByName;
      }
focal_method.class_method_signature: GitHubUtil.getReposForUserAtCurrentInstant(GHMyself user)
focal_method.full_signature: public Map<String, GHRepository> getReposForUserAtCurrentInstant(GHMyself user)
focal_method.identifier: getReposForUserAtCurrentInstant
focal_method.invocations: listRepositories put getName
focal_method.modifiers: public
focal_method.parameters: (GHMyself user)
focal_method.return: Map<String, GHRepository>
focal_method.signature: Map<String, GHRepository> getReposForUserAtCurrentInstant(GHMyself user)