@Test public void testGetForkNotFoundFromExistingRecords() { String reponame = "reponame"; DockerfileGitHubUtil dockerfileGitHubUtil = mock(DockerfileGitHubUtil.class); GitHubPullRequestSender gitHubPullRequestSender = new GitHubPullRequestSender(dockerfileGitHubUtil, mock(ForkableRepoValidator.class)); Multimap<String, GitHubContentToProcess> processMultimap = HashMultimap.create(); assertNull(gitHubPullRequestSender.getForkFromExistingRecordToProcess(processMultimap, reponame)); }
protected GHRepository getForkFromExistingRecordToProcess(Multimap<String, GitHubContentToProcess> pathToDockerfilesInParentRepo, String parentRepoName) { if (pathToDockerfilesInParentRepo.containsKey(parentRepoName)) { Optional<GitHubContentToProcess> firstForkData = pathToDockerfilesInParentRepo.get(parentRepoName).stream().findFirst(); if (firstForkData.isPresent()) { return firstForkData.get().getFork(); } else { log.warn("For some reason we have data inconsistency when trying to find the fork for {}", parentRepoName); } } return null; }
GitHubPullRequestSender { protected GHRepository getForkFromExistingRecordToProcess(Multimap<String, GitHubContentToProcess> pathToDockerfilesInParentRepo, String parentRepoName) { if (pathToDockerfilesInParentRepo.containsKey(parentRepoName)) { Optional<GitHubContentToProcess> firstForkData = pathToDockerfilesInParentRepo.get(parentRepoName).stream().findFirst(); if (firstForkData.isPresent()) { return firstForkData.get().getFork(); } else { log.warn("For some reason we have data inconsistency when trying to find the fork for {}", parentRepoName); } } return null; } }
GitHubPullRequestSender { protected GHRepository getForkFromExistingRecordToProcess(Multimap<String, GitHubContentToProcess> pathToDockerfilesInParentRepo, String parentRepoName) { if (pathToDockerfilesInParentRepo.containsKey(parentRepoName)) { Optional<GitHubContentToProcess> firstForkData = pathToDockerfilesInParentRepo.get(parentRepoName).stream().findFirst(); if (firstForkData.isPresent()) { return firstForkData.get().getFork(); } else { log.warn("For some reason we have data inconsistency when trying to find the fork for {}", parentRepoName); } } return null; } GitHubPullRequestSender(DockerfileGitHubUtil dockerfileGitHubUtil, ForkableRepoValidator forkableRepoValidator); }
GitHubPullRequestSender { protected GHRepository getForkFromExistingRecordToProcess(Multimap<String, GitHubContentToProcess> pathToDockerfilesInParentRepo, String parentRepoName) { if (pathToDockerfilesInParentRepo.containsKey(parentRepoName)) { Optional<GitHubContentToProcess> firstForkData = pathToDockerfilesInParentRepo.get(parentRepoName).stream().findFirst(); if (firstForkData.isPresent()) { return firstForkData.get().getFork(); } else { log.warn("For some reason we have data inconsistency when trying to find the fork for {}", parentRepoName); } } return null; } GitHubPullRequestSender(DockerfileGitHubUtil dockerfileGitHubUtil, ForkableRepoValidator forkableRepoValidator); Multimap<String, GitHubContentToProcess> forkRepositoriesFoundAndGetPathToDockerfiles(
            PagedSearchIterable<GHContent> contentsWithImage,
            GitForkBranch gitForkBranch); }
GitHubPullRequestSender { protected GHRepository getForkFromExistingRecordToProcess(Multimap<String, GitHubContentToProcess> pathToDockerfilesInParentRepo, String parentRepoName) { if (pathToDockerfilesInParentRepo.containsKey(parentRepoName)) { Optional<GitHubContentToProcess> firstForkData = pathToDockerfilesInParentRepo.get(parentRepoName).stream().findFirst(); if (firstForkData.isPresent()) { return firstForkData.get().getFork(); } else { log.warn("For some reason we have data inconsistency when trying to find the fork for {}", parentRepoName); } } return null; } GitHubPullRequestSender(DockerfileGitHubUtil dockerfileGitHubUtil, ForkableRepoValidator forkableRepoValidator); Multimap<String, GitHubContentToProcess> forkRepositoriesFoundAndGetPathToDockerfiles(
            PagedSearchIterable<GHContent> contentsWithImage,
            GitForkBranch gitForkBranch); static final String REPO_IS_FORK; }