test_class.file: dockerfile-image-update/src/test/java/com/salesforce/dockerfileimageupdate/subcommands/impl/ChildTest.java
test_class.identifier: ChildTest
test_case.body: @Test
      public void testCreateForkFailureCase_CreatePullReqIsSkipped() throws IOException, InterruptedException {
          Child child = new Child();
          Map<String, Object> nsMap = ImmutableMap.of(
                  GIT_REPO, "test",
                  IMG, "test",
                  FORCE_TAG, "test",
                  STORE, "test");
          Namespace ns = new Namespace(nsMap);
          DockerfileGitHubUtil dockerfileGitHubUtil = mock(DockerfileGitHubUtil.class);
          GitHubJsonStore gitHubJsonStore = mock(GitHubJsonStore.class);
          when(dockerfileGitHubUtil.getGitHubJsonStore(anyString())).thenReturn(gitHubJsonStore);
          Mockito.when(dockerfileGitHubUtil.getRepo(Mockito.any())).thenReturn(new GHRepository());
          Mockito.when(dockerfileGitHubUtil.getOrCreateFork(Mockito.any())).thenReturn(null);
          child.execute(ns, dockerfileGitHubUtil);
          Mockito.verify(dockerfileGitHubUtil, Mockito.never()).createPullReq(Mockito.any(), Mockito.any(), Mockito.any(),
                  Mockito.any());
      }
test_case.class_method_signature: ChildTest.testCreateForkFailureCase_CreatePullReqIsSkipped()
test_case.full_signature: @Test public void testCreateForkFailureCase_CreatePullReqIsSkipped()
test_case.identifier: testCreateForkFailureCase_CreatePullReqIsSkipped
test_case.invocations: of mock mock thenReturn when getGitHubJsonStore anyString thenReturn when getRepo any thenReturn when getOrCreateFork any execute createPullReq verify never any any any any
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreateForkFailureCase_CreatePullReqIsSkipped()
focal_class.declarator: log = LoggerFactory.getLogger(Child.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(Child.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.file: dockerfile-image-update/src/main/java/com/salesforce/dockerfileimageupdate/subcommands/impl/Child.java
focal_class.identifier: Child
focal_class.interfaces: implements ExecutableWithNamespace
focal_class.class_method_signature: Child.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_method.body: @Override
      public void execute(final Namespace ns, final DockerfileGitHubUtil dockerfileGitHubUtil)
              throws IOException, InterruptedException {
          String branch = ns.get(Constants.GIT_BRANCH);
          String img = ns.get(Constants.IMG);
          String forceTag = ns.get(Constants.FORCE_TAG);
  
          /* Updates store if a store is specified. */
          dockerfileGitHubUtil.getGitHubJsonStore(ns.get(Constants.STORE)).updateStore(img, forceTag);
  
          log.info("Retrieving repository and creating fork...");
          GHRepository repo = dockerfileGitHubUtil.getRepo(ns.get(Constants.GIT_REPO));
          GHRepository fork = dockerfileGitHubUtil.getOrCreateFork(repo);
          if (fork == null) {
              log.info("Unable to fork {}. Please make sure that the repo is forkable.",
                      repo.getFullName());
              return;
          }
  
          GitForkBranch gitForkBranch = new GitForkBranch(img, forceTag, branch);
          PullRequestInfo pullRequestInfo =
                  new PullRequestInfo(ns.get(Constants.GIT_PR_TITLE),
                          gitForkBranch.getImageName(),
                          gitForkBranch.getImageTag());
  
          dockerfileGitHubUtil.createOrUpdateForkBranchToParentDefault(repo, fork, gitForkBranch);
  
          log.info("Modifying on Github...");
          dockerfileGitHubUtil.modifyAllOnGithub(fork, gitForkBranch.getBranchName(), img, forceTag);
          dockerfileGitHubUtil.createPullReq(repo,
                  gitForkBranch.getBranchName(),
                  fork,
                  pullRequestInfo);
      }
focal_method.class_method_signature: Child.execute(final Namespace ns, final DockerfileGitHubUtil dockerfileGitHubUtil)
focal_method.full_signature: @Override public void execute(final Namespace ns, final DockerfileGitHubUtil dockerfileGitHubUtil)
focal_method.identifier: execute
focal_method.invocations: get get get updateStore getGitHubJsonStore get info getRepo get getOrCreateFork info getFullName get getImageName getImageTag createOrUpdateForkBranchToParentDefault info modifyAllOnGithub getBranchName createPullReq getBranchName
focal_method.modifiers: @Override public
focal_method.parameters: (final Namespace ns, final DockerfileGitHubUtil dockerfileGitHubUtil)
focal_method.return: void
focal_method.signature: void execute(final Namespace ns, final DockerfileGitHubUtil dockerfileGitHubUtil)