test_class.declarator: gitHubUtil
test_class.modifier: @Mock
test_class.original_string: @Mock
      GitHubUtil gitHubUtil;
test_class.type: GitHubUtil
test_class.var_name: gitHubUtil
test_class.declarator: dockerfileGitHubUtil
test_class.modifier: private
test_class.original_string: private DockerfileGitHubUtil dockerfileGitHubUtil;
test_class.type: DockerfileGitHubUtil
test_class.var_name: dockerfileGitHubUtil
test_class.file: dockerfile-image-update/src/test/java/com/salesforce/dockerfileimageupdate/utils/DockerfileGitHubUtilTest.java
test_class.identifier: DockerfileGitHubUtilTest
test_case.body: @Test
      public void testGetGHContents() throws Exception {
          DockerfileGitHubUtil dockerfileGitHubUtil = mock(DockerfileGitHubUtil.class);
  
          GHContent content1 = mock(GHContent.class);
          GHContent content2 = mock(GHContent.class);
          GHContent content3 = mock(GHContent.class);
  
          PagedSearchIterable<GHContent> contentsWithImage = mock(PagedSearchIterable.class);
          when(contentsWithImage.getTotalCount()).thenReturn(3);
  
          PagedIterator<GHContent> contentsWithImageIterator = mock(PagedIterator.class);
          when(contentsWithImageIterator.hasNext()).thenReturn(true, true, true, false);
          when(contentsWithImageIterator.next()).thenReturn(content1, content2, content3, null);
          when(contentsWithImage.iterator()).thenReturn(contentsWithImageIterator);
  
          when(dockerfileGitHubUtil.findFilesWithImage(anyString(), eq("org"))).thenReturn(contentsWithImage);
          when(dockerfileGitHubUtil.getGHContents("org", "image")).thenCallRealMethod();
  
          assertEquals(dockerfileGitHubUtil.getGHContents("org", "image"), Optional.of(contentsWithImage));
      }
test_case.class_method_signature: DockerfileGitHubUtilTest.testGetGHContents()
test_case.full_signature: @Test public void testGetGHContents()
test_case.identifier: testGetGHContents
test_case.invocations: mock mock mock mock mock thenReturn when getTotalCount mock thenReturn when hasNext thenReturn when next thenReturn when iterator thenReturn when findFilesWithImage anyString eq thenCallRealMethod when getGHContents assertEquals getGHContents of
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetGHContents()
focal_class.declarator: log = LoggerFactory.getLogger(DockerfileGitHubUtil.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(DockerfileGitHubUtil.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: gitHubUtil
focal_class.modifier: private final
focal_class.original_string: private final GitHubUtil gitHubUtil;
focal_class.type: GitHubUtil
focal_class.var_name: gitHubUtil
focal_class.file: dockerfile-image-update/src/main/java/com/salesforce/dockerfileimageupdate/utils/DockerfileGitHubUtil.java
focal_class.identifier: DockerfileGitHubUtil
focal_class.class_method_signature: DockerfileGitHubUtil.DockerfileGitHubUtil(GitHubUtil gitHubUtil)
focal_class.full_signature: public  DockerfileGitHubUtil(GitHubUtil gitHubUtil)
focal_class.identifier: DockerfileGitHubUtil
focal_class.modifiers: public
focal_class.parameters: (GitHubUtil gitHubUtil)
focal_class.signature:  DockerfileGitHubUtil(GitHubUtil gitHubUtil)
focal_class.class_method_signature: DockerfileGitHubUtil.getGitHubUtil()
focal_class.full_signature: protected GitHubUtil getGitHubUtil()
focal_class.identifier: getGitHubUtil
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: GitHubUtil
focal_class.signature: GitHubUtil getGitHubUtil()
focal_class.class_method_signature: DockerfileGitHubUtil.getOrCreateFork(GHRepository parent)
focal_class.full_signature: public GHRepository getOrCreateFork(GHRepository parent)
focal_class.identifier: getOrCreateFork
focal_class.modifiers: public
focal_class.parameters: (GHRepository parent)
focal_class.return: GHRepository
focal_class.signature: GHRepository getOrCreateFork(GHRepository parent)
focal_class.class_method_signature: DockerfileGitHubUtil.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: DockerfileGitHubUtil.getRepo(String repoName)
focal_class.full_signature: public GHRepository getRepo(String repoName)
focal_class.identifier: getRepo
focal_class.modifiers: public
focal_class.parameters: (String repoName)
focal_class.return: GHRepository
focal_class.signature: GHRepository getRepo(String repoName)
focal_class.class_method_signature: DockerfileGitHubUtil.findFilesWithImage(String query, String org)
focal_class.full_signature: public PagedSearchIterable<GHContent> findFilesWithImage(String query, String org)
focal_class.identifier: findFilesWithImage
focal_class.modifiers: public
focal_class.parameters: (String query, String org)
focal_class.return: PagedSearchIterable<GHContent>
focal_class.signature: PagedSearchIterable<GHContent> findFilesWithImage(String query, String org)
focal_class.class_method_signature: DockerfileGitHubUtil.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: DockerfileGitHubUtil.modifyAllOnGithub(GHRepository repo, String branch,
                                    String img, String tag)
focal_class.full_signature: public void modifyAllOnGithub(GHRepository repo, String branch,
                                    String img, String tag)
focal_class.identifier: modifyAllOnGithub
focal_class.modifiers: public
focal_class.parameters: (GHRepository repo, String branch,
                                    String img, String tag)
focal_class.return: void
focal_class.signature: void modifyAllOnGithub(GHRepository repo, String branch,
                                    String img, String tag)
focal_class.class_method_signature: DockerfileGitHubUtil.modifyOnGithubRecursive(GHRepository repo, GHContent content,
                                             String branch, String img, String tag)
focal_class.full_signature: protected void modifyOnGithubRecursive(GHRepository repo, GHContent content,
                                             String branch, String img, String tag)
focal_class.identifier: modifyOnGithubRecursive
focal_class.modifiers: protected
focal_class.parameters: (GHRepository repo, GHContent content,
                                             String branch, String img, String tag)
focal_class.return: void
focal_class.signature: void modifyOnGithubRecursive(GHRepository repo, GHContent content,
                                             String branch, String img, String tag)
focal_class.class_method_signature: DockerfileGitHubUtil.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: DockerfileGitHubUtil.modifyOnGithub(GHContent content,
                                 String branch, String img, String tag, String customMessage)
focal_class.full_signature: public void modifyOnGithub(GHContent content,
                                 String branch, String img, String tag, String customMessage)
focal_class.identifier: modifyOnGithub
focal_class.modifiers: public
focal_class.parameters: (GHContent content,
                                 String branch, String img, String tag, String customMessage)
focal_class.return: void
focal_class.signature: void modifyOnGithub(GHContent content,
                                 String branch, String img, String tag, String customMessage)
focal_class.class_method_signature: DockerfileGitHubUtil.findImagesAndFix(GHContent content,
                                      String branch, String img, String tag, String customMessage,
                                      BufferedReader reader)
focal_class.full_signature: protected void findImagesAndFix(GHContent content,
                                      String branch, String img, String tag, String customMessage,
                                      BufferedReader reader)
focal_class.identifier: findImagesAndFix
focal_class.modifiers: protected
focal_class.parameters: (GHContent content,
                                      String branch, String img, String tag, String customMessage,
                                      BufferedReader reader)
focal_class.return: void
focal_class.signature: void findImagesAndFix(GHContent content,
                                      String branch, String img, String tag, String customMessage,
                                      BufferedReader reader)
focal_class.class_method_signature: DockerfileGitHubUtil.rewriteDockerfile(String img, String tag, BufferedReader reader, StringBuilder strB)
focal_class.full_signature: protected boolean rewriteDockerfile(String img, String tag, BufferedReader reader, StringBuilder strB)
focal_class.identifier: rewriteDockerfile
focal_class.modifiers: protected
focal_class.parameters: (String img, String tag, BufferedReader reader, StringBuilder strB)
focal_class.return: boolean
focal_class.signature: boolean rewriteDockerfile(String img, String tag, BufferedReader reader, StringBuilder strB)
focal_class.class_method_signature: DockerfileGitHubUtil.changeIfDockerfileBaseImageLine(String imageToFind, String tag, StringBuilder stringBuilder, String line)
focal_class.full_signature: protected boolean changeIfDockerfileBaseImageLine(String imageToFind, String tag, StringBuilder stringBuilder, String line)
focal_class.identifier: changeIfDockerfileBaseImageLine
focal_class.modifiers: protected
focal_class.parameters: (String imageToFind, String tag, StringBuilder stringBuilder, String line)
focal_class.return: boolean
focal_class.signature: boolean changeIfDockerfileBaseImageLine(String imageToFind, String tag, StringBuilder stringBuilder, String line)
focal_class.class_method_signature: DockerfileGitHubUtil.getGitHubJsonStore(String store)
focal_class.full_signature: public GitHubJsonStore getGitHubJsonStore(String store)
focal_class.identifier: getGitHubJsonStore
focal_class.modifiers: public
focal_class.parameters: (String store)
focal_class.return: GitHubJsonStore
focal_class.signature: GitHubJsonStore getGitHubJsonStore(String store)
focal_class.class_method_signature: DockerfileGitHubUtil.createPullReq(GHRepository origRepo,
                                String branch, GHRepository forkRepo,
                                PullRequestInfo pullRequestInfo)
focal_class.full_signature: public void createPullReq(GHRepository origRepo,
                                String branch, GHRepository forkRepo,
                                PullRequestInfo pullRequestInfo)
focal_class.identifier: createPullReq
focal_class.modifiers: public
focal_class.parameters: (GHRepository origRepo,
                                String branch, GHRepository forkRepo,
                                PullRequestInfo pullRequestInfo)
focal_class.return: void
focal_class.signature: void createPullReq(GHRepository origRepo,
                                String branch, GHRepository forkRepo,
                                PullRequestInfo pullRequestInfo)
focal_class.class_method_signature: DockerfileGitHubUtil.getPullRequestForImageBranch(GHRepository repository, GitForkBranch gitForkBranch)
focal_class.full_signature: public Optional<GHPullRequest> getPullRequestForImageBranch(GHRepository repository, GitForkBranch gitForkBranch)
focal_class.identifier: getPullRequestForImageBranch
focal_class.modifiers: public
focal_class.parameters: (GHRepository repository, GitForkBranch gitForkBranch)
focal_class.return: Optional<GHPullRequest>
focal_class.signature: Optional<GHPullRequest> getPullRequestForImageBranch(GHRepository repository, GitForkBranch gitForkBranch)
focal_class.class_method_signature: DockerfileGitHubUtil.createOrUpdateForkBranchToParentDefault(GHRepository parent, GHRepository fork, GitForkBranch gitForkBranch)
focal_class.full_signature: public void createOrUpdateForkBranchToParentDefault(GHRepository parent, GHRepository fork, GitForkBranch gitForkBranch)
focal_class.identifier: createOrUpdateForkBranchToParentDefault
focal_class.modifiers: public
focal_class.parameters: (GHRepository parent, GHRepository fork, GitForkBranch gitForkBranch)
focal_class.return: void
focal_class.signature: void createOrUpdateForkBranchToParentDefault(GHRepository parent, GHRepository fork, GitForkBranch gitForkBranch)
focal_class.class_method_signature: DockerfileGitHubUtil.thisUserIsOwner(GHRepository repo)
focal_class.full_signature: public boolean thisUserIsOwner(GHRepository repo)
focal_class.identifier: thisUserIsOwner
focal_class.modifiers: public
focal_class.parameters: (GHRepository repo)
focal_class.return: boolean
focal_class.signature: boolean thisUserIsOwner(GHRepository repo)
focal_class.class_method_signature: DockerfileGitHubUtil.getGHContents(String org, String img)
focal_class.full_signature: public Optional<PagedSearchIterable<GHContent>> getGHContents(String org, String img)
focal_class.identifier: getGHContents
focal_class.modifiers: public
focal_class.parameters: (String org, String img)
focal_class.return: Optional<PagedSearchIterable<GHContent>>
focal_class.signature: Optional<PagedSearchIterable<GHContent>> getGHContents(String org, String img)
focal_method.body: public Optional<PagedSearchIterable<GHContent>> getGHContents(String org, String img)
              throws IOException, InterruptedException {
          PagedSearchIterable<GHContent> contentsWithImage = null;
          for (int i = 0; i < 5; i++) {
              contentsWithImage = findFilesWithImage(img, org);
              if (contentsWithImage.getTotalCount() > 0) {
                  break;
              } else {
                  getGitHubUtil().waitFor(TimeUnit.SECONDS.toMillis(1));
              }
          }
  
          int numOfContentsFound = contentsWithImage.getTotalCount();
          if (numOfContentsFound <= 0) {
              log.info("Could not find any repositories with given image: {}", img);
              return Optional.empty();
          }
          return Optional.of(contentsWithImage);
      }
focal_method.class_method_signature: DockerfileGitHubUtil.getGHContents(String org, String img)
focal_method.full_signature: public Optional<PagedSearchIterable<GHContent>> getGHContents(String org, String img)
focal_method.identifier: getGHContents
focal_method.invocations: findFilesWithImage getTotalCount waitFor getGitHubUtil toMillis getTotalCount info empty of
focal_method.modifiers: public
focal_method.parameters: (String org, String img)
focal_method.return: Optional<PagedSearchIterable<GHContent>>
focal_method.signature: Optional<PagedSearchIterable<GHContent>> getGHContents(String org, String img)