RenamePopUpPresenter { public void show(final Path path, final Validator validator, final CommandWithFileNameAndCommitMessage renameCommand, final CommandWithFileNameAndCommitMessage saveAndRenameCommand, final boolean isDirty, final String originalFileName) { this.validator = checkNotNull("validator", validator); this.path = checkNotNull("path", path); this.renameCommand = checkNotNull("renameCommand", renameCommand); this.saveAndRenameCommand = checkNotNull("saveAndRenameCommand", saveAndRenameCommand); this.originalFileName = checkNotNull("originalFileName", originalFileName); this.isDirty = checkNotNull("isDirty", isDirty); setupView(); showView(); } @Inject  RenamePopUpPresenter(final View view,
                                final ToggleCommentPresenter toggleCommentPresenter); void show(final Path path,
                     final Validator validator,
                     final CommandWithFileNameAndCommitMessage renameCommand,
                     final CommandWithFileNameAndCommitMessage saveAndRenameCommand,
                     final boolean isDirty,
                     final String originalFileName); void show(final Path path,
                     final CommandWithFileNameAndCommitMessage renameCommand,
                     final String originalFileName); void show(final Path path,
                     final Validator validator,
                     final CommandWithFileNameAndCommitMessage renameCommand); void show(final Path path,
                     final Validator validator,
                     final boolean isDirty,
                     final CommandWithFileNameAndCommitMessage renameCommand,
                     final CommandWithFileNameAndCommitMessage saveAndRenameCommand); void show(final Path path,
                     final CommandWithFileNameAndCommitMessage renameCommand); @PostConstruct void setup(); void rename(final String newName); void saveAndRename(final String newName); void cancel(); View getView(); ToggleCommentPresenter getToggleCommentPresenter();  }
@Test public void testShow() throws Exception { presenter.show(path, validator, renameCommand); assertNotNull(presenter.getPath()); assertNotNull(presenter.getValidator()); assertNotNull(presenter.getRenameCommand()); verify(presenter).setupView(); verify(presenter).showView(); }
@Test(expected = IllegalArgumentException.class) public void testShowMissingPath() throws Exception { presenter.show(null, validator, renameCommand); }
@Test(expected = IllegalArgumentException.class) public void testShowMissingValidator() throws Exception { presenter.show(path, null, renameCommand); }
@Test(expected = IllegalArgumentException.class) public void testShowMissingRenameCommand() throws Exception { final boolean isDirty = true; final String fileName = "file.plugin"; presenter.show(path, validator, null, saveAndRenameCommand, isDirty, fileName); }
@Test(expected = IllegalArgumentException.class) public void testShowMissingSaveAndRenameCommand() throws Exception { final boolean isDirty = true; final String fileName = "file.plugin"; presenter.show(path, validator, renameCommand, null, isDirty, fileName); }
@Test(expected = IllegalArgumentException.class) public void testShowMissingCommand() throws Exception { presenter.show(path, validator, null); }