test_class.file: dockerfile-image-update/src/test/java/com/salesforce/dockerfileimageupdate/subcommands/impl/AllTest.java
test_class.identifier: AllTest
test_case.body: @Test
      public void testParseStoreToImagesMap() throws Exception {
          DockerfileGitHubUtil dockerfileGitHubUtil = mock(DockerfileGitHubUtil.class);
          when(dockerfileGitHubUtil.getMyself()).thenReturn(mock(GHMyself.class));
          when(dockerfileGitHubUtil.getRepo(anyString())).thenReturn(mock(GHRepository.class));
          GHContent mockContent = mock(GHContent.class);
          ClassLoader classloader = Thread.currentThread().getContextClassLoader();
          when(mockContent.read()).thenReturn(classloader.getResourceAsStream("image-store-sample.json"));
          when(dockerfileGitHubUtil.tryRetrievingContent(any(GHRepository.class), anyString(), anyString())).thenReturn(mockContent);
  
          All all = new All();
          all.loadDockerfileGithubUtil(dockerfileGitHubUtil);
          Set<Map.Entry<String, JsonElement>> imageSet = all.parseStoreToImagesMap("testStore");
          assertNotNull(imageSet);
      }
test_case.class_method_signature: AllTest.testParseStoreToImagesMap()
test_case.full_signature: @Test public void testParseStoreToImagesMap()
test_case.identifier: testParseStoreToImagesMap
test_case.invocations: mock thenReturn when getMyself mock thenReturn when getRepo anyString mock mock getContextClassLoader currentThread thenReturn when read getResourceAsStream thenReturn when tryRetrievingContent any anyString anyString loadDockerfileGithubUtil parseStoreToImagesMap assertNotNull
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testParseStoreToImagesMap()
focal_class.declarator: log = LoggerFactory.getLogger(All.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(All.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: dockerfileGitHubUtil
focal_class.modifier: private
focal_class.original_string: private DockerfileGitHubUtil dockerfileGitHubUtil;
focal_class.type: DockerfileGitHubUtil
focal_class.var_name: dockerfileGitHubUtil
focal_class.file: dockerfile-image-update/src/main/java/com/salesforce/dockerfileimageupdate/subcommands/impl/All.java
focal_class.identifier: All
focal_class.interfaces: implements ExecutableWithNamespace
focal_class.class_method_signature: All.execute(final Namespace ns, final DockerfileGitHubUtil dockerfileGitHubUtil)
focal_class.full_signature: @Override public void execute(final Namespace ns, final DockerfileGitHubUtil dockerfileGitHubUtil)
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: (final Namespace ns, final DockerfileGitHubUtil dockerfileGitHubUtil)
focal_class.return: void
focal_class.signature: void execute(final Namespace ns, final DockerfileGitHubUtil dockerfileGitHubUtil)
focal_class.class_method_signature: All.loadDockerfileGithubUtil(DockerfileGitHubUtil _dockerfileGitHubUtil)
focal_class.full_signature: protected void loadDockerfileGithubUtil(DockerfileGitHubUtil _dockerfileGitHubUtil)
focal_class.identifier: loadDockerfileGithubUtil
focal_class.modifiers: protected
focal_class.parameters: (DockerfileGitHubUtil _dockerfileGitHubUtil)
focal_class.return: void
focal_class.signature: void loadDockerfileGithubUtil(DockerfileGitHubUtil _dockerfileGitHubUtil)
focal_class.class_method_signature: All.forkRepositoriesFound(Multimap<String, String> pathToDockerfilesInParentRepo,
                                           Multimap<String, String> imagesFoundInParentRepo,
                                           PagedSearchIterable<GHContent> contentsWithImage,
                                           String image)
focal_class.full_signature: protected void forkRepositoriesFound(Multimap<String, String> pathToDockerfilesInParentRepo,
                                           Multimap<String, String> imagesFoundInParentRepo,
                                           PagedSearchIterable<GHContent> contentsWithImage,
                                           String image)
focal_class.identifier: forkRepositoriesFound
focal_class.modifiers: protected
focal_class.parameters: (Multimap<String, String> pathToDockerfilesInParentRepo,
                                           Multimap<String, String> imagesFoundInParentRepo,
                                           PagedSearchIterable<GHContent> contentsWithImage,
                                           String image)
focal_class.return: void
focal_class.signature: void forkRepositoriesFound(Multimap<String, String> pathToDockerfilesInParentRepo,
                                           Multimap<String, String> imagesFoundInParentRepo,
                                           PagedSearchIterable<GHContent> contentsWithImage,
                                           String image)
focal_class.class_method_signature: All.parseStoreToImagesMap(String storeName)
focal_class.full_signature: protected Set<Map.Entry<String, JsonElement>> parseStoreToImagesMap(String storeName)
focal_class.identifier: parseStoreToImagesMap
focal_class.modifiers: protected
focal_class.parameters: (String storeName)
focal_class.return: Set<Map.Entry<String, JsonElement>>
focal_class.signature: Set<Map.Entry<String, JsonElement>> parseStoreToImagesMap(String storeName)
focal_class.class_method_signature: All.changeDockerfiles(Namespace ns,
                                       Multimap<String, String> pathToDockerfilesInParentRepo,
                                       Multimap<String, String> imagesFoundInParentRepo,
                                       Map<String, String> imageToTagMap,
                                       GHRepository currUserRepo,
                                       List<String> skippedRepos)
focal_class.full_signature: protected void changeDockerfiles(Namespace ns,
                                       Multimap<String, String> pathToDockerfilesInParentRepo,
                                       Multimap<String, String> imagesFoundInParentRepo,
                                       Map<String, String> imageToTagMap,
                                       GHRepository currUserRepo,
                                       List<String> skippedRepos)
focal_class.identifier: changeDockerfiles
focal_class.modifiers: protected
focal_class.parameters: (Namespace ns,
                                       Multimap<String, String> pathToDockerfilesInParentRepo,
                                       Multimap<String, String> imagesFoundInParentRepo,
                                       Map<String, String> imageToTagMap,
                                       GHRepository currUserRepo,
                                       List<String> skippedRepos)
focal_class.return: void
focal_class.signature: void changeDockerfiles(Namespace ns,
                                       Multimap<String, String> pathToDockerfilesInParentRepo,
                                       Multimap<String, String> imagesFoundInParentRepo,
                                       Map<String, String> imageToTagMap,
                                       GHRepository currUserRepo,
                                       List<String> skippedRepos)
focal_class.class_method_signature: All.getPullRequestWithPullReqIdentifier(GHRepository parent)
focal_class.full_signature: private GHPullRequest getPullRequestWithPullReqIdentifier(GHRepository parent)
focal_class.identifier: getPullRequestWithPullReqIdentifier
focal_class.modifiers: private
focal_class.parameters: (GHRepository parent)
focal_class.return: GHPullRequest
focal_class.signature: GHPullRequest getPullRequestWithPullReqIdentifier(GHRepository parent)
focal_method.body: protected Set<Map.Entry<String, JsonElement>> parseStoreToImagesMap(String storeName)
              throws IOException, InterruptedException {
          GHMyself myself = dockerfileGitHubUtil.getMyself();
          String login = myself.getLogin();
          GHRepository store = dockerfileGitHubUtil.getRepo(Paths.get(login, storeName).toString());
  
          GHContent storeContent = dockerfileGitHubUtil.tryRetrievingContent(store, Constants.STORE_JSON_FILE,
                  store.getDefaultBranch());
  
          if (storeContent == null) {
              return Collections.emptySet();
          }
  
          JsonElement json;
          try (InputStream stream = storeContent.read(); InputStreamReader streamR = new InputStreamReader(stream)) {
              try {
                  json = JsonParser.parseReader(streamR);
              } catch (JsonParseException e) {
                  log.warn("Not a JSON format store.");
                  return Collections.emptySet();
              }
          }
  
          JsonElement imagesJson = json.getAsJsonObject().get("images");
          return imagesJson.getAsJsonObject().entrySet();
      }
focal_method.class_method_signature: All.parseStoreToImagesMap(String storeName)
focal_method.full_signature: protected Set<Map.Entry<String, JsonElement>> parseStoreToImagesMap(String storeName)
focal_method.identifier: parseStoreToImagesMap
focal_method.invocations: getMyself getLogin getRepo toString get tryRetrievingContent getDefaultBranch emptySet read parseReader warn emptySet get getAsJsonObject entrySet getAsJsonObject
focal_method.modifiers: protected
focal_method.parameters: (String storeName)
focal_method.return: Set<Map.Entry<String, JsonElement>>
focal_method.signature: Set<Map.Entry<String, JsonElement>> parseStoreToImagesMap(String storeName)