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 testCreatePullReq_Delete() throws Exception {
          gitHubUtil = mock(GitHubUtil.class);
  
          GHRepository forkRepo = mock(GHRepository.class);
          GHPullRequestQueryBuilder prBuilder = mock(GHPullRequestQueryBuilder.class);
          when(prBuilder.state(GHIssueState.OPEN)).thenReturn(prBuilder);
          PagedIterable<GHPullRequest> iteratable = mock(PagedIterable.class);
          when(prBuilder.list()).thenReturn(iteratable);
          PagedIterator<GHPullRequest> iterator = mock(PagedIterator.class);
          when(iterator.hasNext()).thenReturn(false);
          when(iteratable.iterator()).thenReturn(iterator);
          when(forkRepo.queryPullRequests()).thenReturn(prBuilder);
          when(gitHubUtil.createPullReq(any(), anyString(), any(), anyString(), eq(Constants.PULL_REQ_ID))).thenReturn(1);
          doCallRealMethod().when(gitHubUtil).safeDeleteRepo(forkRepo);
          dockerfileGitHubUtil = new DockerfileGitHubUtil(gitHubUtil);
          PullRequestInfo pullRequestInfo = new PullRequestInfo(null, null, null);
          dockerfileGitHubUtil.createPullReq(new GHRepository(), "branch", forkRepo, pullRequestInfo);
          verify(gitHubUtil, times(1)).createPullReq(any(), anyString(), any(), anyString(), eq(Constants.PULL_REQ_ID));
          verify(forkRepo, times(1)).delete();
      }
test_case.class_method_signature: DockerfileGitHubUtilTest.testCreatePullReq_Delete()
test_case.full_signature: @Test public void testCreatePullReq_Delete()
test_case.identifier: testCreatePullReq_Delete
test_case.invocations: mock mock mock thenReturn when state mock thenReturn when list mock thenReturn when hasNext thenReturn when iterator thenReturn when queryPullRequests thenReturn when createPullReq any anyString any anyString eq safeDeleteRepo when doCallRealMethod createPullReq createPullReq verify times any anyString any anyString eq delete verify times
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreatePullReq_Delete()
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 void createPullReq(GHRepository origRepo,
                                String branch, GHRepository forkRepo,
                                PullRequestInfo pullRequestInfo) throws InterruptedException, IOException {
          // TODO: This may loop forever in the event of constant -1 pullRequestExitCodes...
          while (true) {
              int pullRequestExitCode = gitHubUtil.createPullReq(origRepo,
                      branch, forkRepo, pullRequestInfo.getTitle(), pullRequestInfo.getBody());
              if (pullRequestExitCode == 0) {
                  return;
              } else if (pullRequestExitCode == 1) {
                  gitHubUtil.safeDeleteRepo(forkRepo);
                  return;
              }
          }
      }
focal_method.class_method_signature: DockerfileGitHubUtil.createPullReq(GHRepository origRepo,
                                String branch, GHRepository forkRepo,
                                PullRequestInfo pullRequestInfo)
focal_method.full_signature: public void createPullReq(GHRepository origRepo,
                                String branch, GHRepository forkRepo,
                                PullRequestInfo pullRequestInfo)
focal_method.identifier: createPullReq
focal_method.invocations: createPullReq getTitle getBody safeDeleteRepo
focal_method.modifiers: public
focal_method.parameters: (GHRepository origRepo,
                                String branch, GHRepository forkRepo,
                                PullRequestInfo pullRequestInfo)
focal_method.return: void
focal_method.signature: void createPullReq(GHRepository origRepo,
                                String branch, GHRepository forkRepo,
                                PullRequestInfo pullRequestInfo)