@Test public void testParentIsArchivedDoNotForkIt() { DockerfileGitHubUtil dockerfileGitHubUtil = mock(DockerfileGitHubUtil.class); GHRepository repo = mock(GHRepository.class); ForkableRepoValidator validator = new ForkableRepoValidator(dockerfileGitHubUtil); when(repo.isArchived()).thenReturn(true); ShouldForkResult shouldForkResult = validator.parentIsArchived(repo); assertFalse(shouldForkResult.isForkable()); assertEquals(shouldForkResult.getReason(), REPO_IS_ARCHIVED); }
protected ShouldForkResult parentIsArchived(GHRepository parentRepo) { return parentRepo.isArchived() ? shouldNotForkResult(REPO_IS_ARCHIVED) : shouldForkResult(); }
ForkableRepoValidator { protected ShouldForkResult parentIsArchived(GHRepository parentRepo) { return parentRepo.isArchived() ? shouldNotForkResult(REPO_IS_ARCHIVED) : shouldForkResult(); } }
ForkableRepoValidator { protected ShouldForkResult parentIsArchived(GHRepository parentRepo) { return parentRepo.isArchived() ? shouldNotForkResult(REPO_IS_ARCHIVED) : shouldForkResult(); } ForkableRepoValidator(DockerfileGitHubUtil dockerfileGitHubUtil); }
ForkableRepoValidator { protected ShouldForkResult parentIsArchived(GHRepository parentRepo) { return parentRepo.isArchived() ? shouldNotForkResult(REPO_IS_ARCHIVED) : shouldForkResult(); } ForkableRepoValidator(DockerfileGitHubUtil dockerfileGitHubUtil); ShouldForkResult shouldFork(GHRepository parentRepo,
                                       GHContent searchResultContent,
                                       GitForkBranch gitForkBranch); }
ForkableRepoValidator { protected ShouldForkResult parentIsArchived(GHRepository parentRepo) { return parentRepo.isArchived() ? shouldNotForkResult(REPO_IS_ARCHIVED) : shouldForkResult(); } ForkableRepoValidator(DockerfileGitHubUtil dockerfileGitHubUtil); ShouldForkResult shouldFork(GHRepository parentRepo,
                                       GHContent searchResultContent,
                                       GitForkBranch gitForkBranch); static final String REPO_IS_FORK; static final String REPO_IS_ARCHIVED; static final String REPO_IS_OWNED_BY_THIS_USER; static final String COULD_NOT_CHECK_THIS_USER; static final String CONTENT_PATH_NOT_IN_DEFAULT_BRANCH_TEMPLATE; static final String COULD_NOT_FIND_IMAGE_TO_UPDATE_TEMPLATE; }