GitHub { public static boolean shouldNotProcessDockerfilesInRepo(Multimap<String, String> pathToDockerfilesInParentRepo, GHRepository parent) { if (parent == null || !pathToDockerfilesInParentRepo.containsKey(parent.getFullName()) || parent.isArchived()) { if (parent != null && parent.isArchived()) { log.info("Skipping archived repo: {}", parent.getFullName()); } return true; } return false; }  static boolean shouldNotProcessDockerfilesInRepo(Multimap<String, String> pathToDockerfilesInParentRepo, GHRepository parent);  }
@Test public void testShouldNotProcessBecauseNullParent() { assertTrue(GitHub.shouldNotProcessDockerfilesInRepo(null, null)); }
@Test public void testShouldNotProcessBecauseDidNotFindDockerfiles() { gitHubRepository = mock(GHRepository.class); when(gitHubRepository.getFullName()).thenReturn(repoName); Multimap<String, String> multimap = HashMultimap.create(); assertTrue(GitHub.shouldNotProcessDockerfilesInRepo(multimap, gitHubRepository)); }
@Test public void testShouldNotProcessBecauseIsArchived() { gitHubRepository = mock(GHRepository.class); when(gitHubRepository.getFullName()).thenReturn(repoName); when(gitHubRepository.isArchived()).thenReturn(true); Multimap<String, String> multimap = HashMultimap.create(); multimap.put(repoName, null); assertTrue(GitHub.shouldNotProcessDockerfilesInRepo(multimap, gitHubRepository)); }
@Test public void testShouldProcess() { gitHubRepository = mock(GHRepository.class); when(gitHubRepository.getFullName()).thenReturn(repoName); Multimap<String, String> multimap = HashMultimap.create(); multimap.put(repoName, null); assertFalse(GitHub.shouldNotProcessDockerfilesInRepo(multimap, gitHubRepository)); }