### Question:
FileOpenRequestHandler { public void handleLaunchArgs(String[] args) { handleLaunchArgs(FileSystems.getDefault(), args); } @Inject  FileOpenRequestHandler(@Named("launchEventQueue") BlockingQueue<AppLaunchEvent> launchEventQueue); void handleLaunchArgs(String[] args);  }### Answer:
@Test @DisplayName("./cryptomator.exe foo bar") public void testOpenArgsWithCorrectPaths() { inTest.handleLaunchArgs(new String[]{"foo", "bar"}); AppLaunchEvent evt = queue.poll(); Assertions.assertNotNull(evt); Collection<Path> paths = evt.getPathsToOpen(); MatcherAssert.assertThat(paths, CoreMatchers.hasItems(Paths.get("foo"), Paths.get("bar"))); }
@Test @DisplayName("./cryptomator.exe foo (with 'foo' being an invalid path)") public void testOpenArgsWithIncorrectPaths() { FileSystem fs = Mockito.mock(FileSystem.class); Mockito.when(fs.getPath("foo")).thenThrow(new InvalidPathException("foo", "foo is not a path")); inTest.handleLaunchArgs(fs, new String[]{"foo"}); AppLaunchEvent evt = queue.poll(); Assertions.assertNull(evt); }
@Test @DisplayName("./cryptomator.exe foo (with full event queue)") public void testOpenArgsWithFullQueue() { queue.add(new AppLaunchEvent(AppLaunchEvent.EventType.OPEN_FILE, Collections.emptyList())); Assumptions.assumeTrue(queue.remainingCapacity() == 0); inTest.handleLaunchArgs(new String[]{"foo"}); }