@Test public void testStackIsNull() { Image image = mock(Image.class); when(image.getStackDetails()).thenReturn(new StackDetails("1", new StackRepoDetails(null, null), "1")); boolean result = underTest.filterImage(image, mock(Image.class)); assertFalse(result); }
@Override public boolean filterImage(Image image, Image currentImage) { if (isRelevantFieldNull(image, currentImage)) { LOGGER.debug("Image or some part of it is null: {}", image); return false; } else { String repoUrl = image.getStackDetails().getRepo().getStack().getOrDefault(currentImage.getOsType(), ""); LOGGER.debug("Matching URL: [{}]", repoUrl); return URL_PATTERN.matcher(repoUrl).find(); } }
CdhPackageLocationFilter implements PackageLocationFilter { @Override public boolean filterImage(Image image, Image currentImage) { if (isRelevantFieldNull(image, currentImage)) { LOGGER.debug("Image or some part of it is null: {}", image); return false; } else { String repoUrl = image.getStackDetails().getRepo().getStack().getOrDefault(currentImage.getOsType(), ""); LOGGER.debug("Matching URL: [{}]", repoUrl); return URL_PATTERN.matcher(repoUrl).find(); } } }
CdhPackageLocationFilter implements PackageLocationFilter { @Override public boolean filterImage(Image image, Image currentImage) { if (isRelevantFieldNull(image, currentImage)) { LOGGER.debug("Image or some part of it is null: {}", image); return false; } else { String repoUrl = image.getStackDetails().getRepo().getStack().getOrDefault(currentImage.getOsType(), ""); LOGGER.debug("Matching URL: [{}]", repoUrl); return URL_PATTERN.matcher(repoUrl).find(); } }  }
CdhPackageLocationFilter implements PackageLocationFilter { @Override public boolean filterImage(Image image, Image currentImage) { if (isRelevantFieldNull(image, currentImage)) { LOGGER.debug("Image or some part of it is null: {}", image); return false; } else { String repoUrl = image.getStackDetails().getRepo().getStack().getOrDefault(currentImage.getOsType(), ""); LOGGER.debug("Matching URL: [{}]", repoUrl); return URL_PATTERN.matcher(repoUrl).find(); } }  @Override boolean filterImage(Image image, Image currentImage); }
CdhPackageLocationFilter implements PackageLocationFilter { @Override public boolean filterImage(Image image, Image currentImage) { if (isRelevantFieldNull(image, currentImage)) { LOGGER.debug("Image or some part of it is null: {}", image); return false; } else { String repoUrl = image.getStackDetails().getRepo().getStack().getOrDefault(currentImage.getOsType(), ""); LOGGER.debug("Matching URL: [{}]", repoUrl); return URL_PATTERN.matcher(repoUrl).find(); } }  @Override boolean filterImage(Image image, Image currentImage);  }