@Test public void testRepoNull() { boolean result = underTest.filterImage(mock(Image.class), mock(Image.class)); assertFalse(result); }
@Override public boolean filterImage(Image image, Image currentImage) { if (image == null || image.getRepo() == null || currentImage == null || StringUtils.isBlank(currentImage.getOsType())) { LOGGER.debug("Image or repo is null: {}", image); return false; } else { String repoUrl = image.getRepo().getOrDefault(currentImage.getOsType(), ""); LOGGER.debug("Matching URL: [{}]", repoUrl); return URL_PATTERN.matcher(repoUrl).find(); } }
ClouderaManagerPackageLocationFilter implements PackageLocationFilter { @Override public boolean filterImage(Image image, Image currentImage) { if (image == null || image.getRepo() == null || currentImage == null || StringUtils.isBlank(currentImage.getOsType())) { LOGGER.debug("Image or repo is null: {}", image); return false; } else { String repoUrl = image.getRepo().getOrDefault(currentImage.getOsType(), ""); LOGGER.debug("Matching URL: [{}]", repoUrl); return URL_PATTERN.matcher(repoUrl).find(); } } }
ClouderaManagerPackageLocationFilter implements PackageLocationFilter { @Override public boolean filterImage(Image image, Image currentImage) { if (image == null || image.getRepo() == null || currentImage == null || StringUtils.isBlank(currentImage.getOsType())) { LOGGER.debug("Image or repo is null: {}", image); return false; } else { String repoUrl = image.getRepo().getOrDefault(currentImage.getOsType(), ""); LOGGER.debug("Matching URL: [{}]", repoUrl); return URL_PATTERN.matcher(repoUrl).find(); } }  }
ClouderaManagerPackageLocationFilter implements PackageLocationFilter { @Override public boolean filterImage(Image image, Image currentImage) { if (image == null || image.getRepo() == null || currentImage == null || StringUtils.isBlank(currentImage.getOsType())) { LOGGER.debug("Image or repo is null: {}", image); return false; } else { String repoUrl = image.getRepo().getOrDefault(currentImage.getOsType(), ""); LOGGER.debug("Matching URL: [{}]", repoUrl); return URL_PATTERN.matcher(repoUrl).find(); } }  @Override boolean filterImage(Image image, Image currentImage); }
ClouderaManagerPackageLocationFilter implements PackageLocationFilter { @Override public boolean filterImage(Image image, Image currentImage) { if (image == null || image.getRepo() == null || currentImage == null || StringUtils.isBlank(currentImage.getOsType())) { LOGGER.debug("Image or repo is null: {}", image); return false; } else { String repoUrl = image.getRepo().getOrDefault(currentImage.getOsType(), ""); LOGGER.debug("Matching URL: [{}]", repoUrl); return URL_PATTERN.matcher(repoUrl).find(); } }  @Override boolean filterImage(Image image, Image currentImage);  }