DownloadMenuItemBuilder { void download(final Supplier<Path> pathSupplier) { final String downloadURL = getFileDownloadURL(pathSupplier); open(downloadURL); } @Inject  DownloadMenuItemBuilder(final TranslationService translationService); MenuItem build(final Supplier<Path> pathSupplier);  }
@Test public void testDownload() { final String expectedDownloadURL = "defaulteditor/download?path=default%3A%2F%2Fmaster%40MySpace%2FMortgages%2Fsrc%2Fmain%2Fresources%2Frule.drl"; when(path.toURI()).thenReturn("default: doNothing().when(downloadMenuItemBuilder).open(any()); downloadMenuItemBuilder.download(pathSupplier); verify(downloadMenuItemBuilder).open(eq(expectedDownloadURL)); }