CommitPresenter implements CommitView.ActionDelegate { @Override public void onValueChanged() { String message = view.getMessage(); view.setEnableCommitButton(!message.isEmpty()); } @Inject  CommitPresenter(CommitView view,
                           GitServiceClient service,
                           GitLocalizationConstant constant,
                           GitOutputPartPresenter console,
                           NotificationManager notificationManager,
                           DtoUnmarshallerFactory dtoUnmarshallerFactory,
                           AppContext appContext,
                           DateTimeFormatter dateTimeFormatter,
                           final SelectionAgent selectionAgent); void showDialog(); @Override void onCommitClicked(); @Override void onCancelClicked(); @Override void onValueChanged(); @Override void setAmendCommitMessage();  }
@Test public void testOnValueChangedWhenCommitMessageEmpty() throws Exception { when(view.getMessage()).thenReturn(EMPTY_TEXT); presenter.onValueChanged(); verify(view).setEnableCommitButton(eq(DISABLE_BUTTON)); }
@Test public void testOnValueChanged() throws Exception { when(view.getMessage()).thenReturn(COMMIT_TEXT); presenter.onValueChanged(); verify(view).setEnableCommitButton(eq(!DISABLE_BUTTON)); }