PrintPath implements Action { @Override public String doAction(@Nonnull Resource resource) { return "\n> " + resource.getPath(); }  @Override String doAction(@Nonnull Resource resource);  }
@Test public void doAction() { String path = "path"; when(resource.getPath()).thenReturn(path); PrintPath action = new PrintPath(); String result = action.doAction(resource); assertTrue(result.contains(path)); }