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(dataProvider = "postTagData")
      public void testFindImagesAndFix_doNotDeletePostTagData(String postTagData, String updatedTag,
                                                              String expectedReplacedData) throws Exception {
          gitHubUtil = mock(GitHubUtil.class);
  
          BufferedReader reader = mock(BufferedReader.class);
          GHContent content = mock(GHContent.class);
          when(content.getPath()).thenReturn("path");
          when(content.update(anyString(), anyString(), anyString())).thenReturn(null);
  
          when(reader.readLine()).thenReturn("hello", "FROM image" + postTagData,
                  "this is a test", null);
  
          dockerfileGitHubUtil = new DockerfileGitHubUtil(gitHubUtil);
  
          StringBuilder strB = new StringBuilder();
          boolean modified = dockerfileGitHubUtil.rewriteDockerfile("image", updatedTag, reader, strB);
  
          assertTrue(modified, "Expect the dockerfile to have been modified");
          assertEquals(strB.toString(), String.format("hello\n%s\nthis is a test\n", expectedReplacedData));
      }
test_case.class_method_signature: DockerfileGitHubUtilTest.testFindImagesAndFix_doNotDeletePostTagData(String postTagData, String updatedTag,
                                                              String expectedReplacedData)
test_case.full_signature: @Test(dataProvider = "postTagData") public void testFindImagesAndFix_doNotDeletePostTagData(String postTagData, String updatedTag,
                                                              String expectedReplacedData)
test_case.identifier: testFindImagesAndFix_doNotDeletePostTagData
test_case.invocations: mock mock mock thenReturn when getPath thenReturn when update anyString anyString anyString thenReturn when readLine rewriteDockerfile assertTrue assertEquals toString format
test_case.modifiers: @Test(dataProvider = "postTagData") public
test_case.parameters: (String postTagData, String updatedTag,
                                                              String expectedReplacedData)
test_case.return: void
test_case.signature: void testFindImagesAndFix_doNotDeletePostTagData(String postTagData, String updatedTag,
                                                              String expectedReplacedData)
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: protected boolean rewriteDockerfile(String img, String tag, BufferedReader reader, StringBuilder strB) throws IOException {
          String line;
          boolean modified = false;
          while ( (line = reader.readLine()) != null ) {
              /* Once true, should stay true. */
              modified = changeIfDockerfileBaseImageLine(img, tag, strB, line) || modified;
          }
          return modified;
      }
focal_method.class_method_signature: DockerfileGitHubUtil.rewriteDockerfile(String img, String tag, BufferedReader reader, StringBuilder strB)
focal_method.full_signature: protected boolean rewriteDockerfile(String img, String tag, BufferedReader reader, StringBuilder strB)
focal_method.identifier: rewriteDockerfile
focal_method.invocations: readLine changeIfDockerfileBaseImageLine
focal_method.modifiers: protected
focal_method.parameters: (String img, String tag, BufferedReader reader, StringBuilder strB)
focal_method.return: boolean
focal_method.signature: boolean rewriteDockerfile(String img, String tag, BufferedReader reader, StringBuilder strB)