@Test public void reductionBelowThreshold_noSuggestion() throws IOException { FakeWebpConverter fakeConverter = new FakeWebpConverter(); WebpSuggester webpSuggester = new WebpSuggester(fakeConverter); int targetOutputSizeAboveThreshold = (int) (DRAWING_FILE_SIZE - WebpSuggester.SIZE_REDUCTION_THRESHOLD_BYTES + 1); fakeConverter.setFakeData(new byte[targetOutputSizeAboveThreshold]); SystemFileData systemFileData = new SystemFileData(getTestDataFile(PNG_DRAWING), Paths.get("drawing.png")); List<Suggestion> suggestions = webpSuggester.processBundleZipEntry( BundleContext.create(MIN_SDK_VERSION_SUPPORTING_LOSSLESS_WEBP), systemFileData); assertThat(suggestions).isEmpty(); }
@Override public ImmutableList<Suggestion> processBundleZipEntry(BundleContext context, FileData fileData) { return processFileEntry(context, fileData); }
WebpSuggester implements BundleEntrySuggester, ProjectTreeSuggester { @Override public ImmutableList<Suggestion> processBundleZipEntry(BundleContext context, FileData fileData) { return processFileEntry(context, fileData); } }
WebpSuggester implements BundleEntrySuggester, ProjectTreeSuggester { @Override public ImmutableList<Suggestion> processBundleZipEntry(BundleContext context, FileData fileData) { return processFileEntry(context, fileData); } WebpSuggester(); @VisibleForTesting  WebpSuggester(WebpConverter webpConverter); }
WebpSuggester implements BundleEntrySuggester, ProjectTreeSuggester { @Override public ImmutableList<Suggestion> processBundleZipEntry(BundleContext context, FileData fileData) { return processFileEntry(context, fileData); } WebpSuggester(); @VisibleForTesting  WebpSuggester(WebpConverter webpConverter); @Override ImmutableList<Suggestion> processBundleZipEntry(BundleContext context, FileData fileData); @Override ImmutableList<Suggestion> processProjectEntry(GradleContext context, FileData fileData); }
WebpSuggester implements BundleEntrySuggester, ProjectTreeSuggester { @Override public ImmutableList<Suggestion> processBundleZipEntry(BundleContext context, FileData fileData) { return processFileEntry(context, fileData); } WebpSuggester(); @VisibleForTesting  WebpSuggester(WebpConverter webpConverter); @Override ImmutableList<Suggestion> processBundleZipEntry(BundleContext context, FileData fileData); @Override ImmutableList<Suggestion> processProjectEntry(GradleContext context, FileData fileData);  }