@BeforeMethod
  public void beforeMethod() {
    MockitoAnnotations.initMocks(this);
    configHolder = new UserConfigHolder();

    when(userOptionsService.getConfigHolder()).thenReturn(configHolder);

    userWorkspaceContext = TestFixture.userWorkspaceContext();
    presenter =
        new TargetContentsPresenter(
            displayProvider,
            editorTranslators,
            eventBus,
            tableEditorMessages,
            sourceContentPresenter,
            userWorkspaceContext,
            editorKeyShortcuts,
            historyPresenter,
            userOptionsService,
            saveAsApprovedConfirmation,
            reviewCommentPresenter);

    verify(eventBus).addHandler(UserConfigChangeEvent.TYPE, presenter);
    verify(eventBus).addHandler(RequestValidationEvent.getType(), presenter);
    verify(eventBus).addHandler(InsertStringInEditorEvent.getType(), presenter);
    verify(eventBus).addHandler(CopyDataToEditorEvent.getType(), presenter);
    verify(eventBus).addHandler(TransUnitEditEvent.getType(), presenter);
    verify(eventBus).addHandler(TransUnitEditEvent.getType(), presenter);
    verify(eventBus).addHandler(WorkspaceContextUpdateEvent.getType(), presenter);
    verify(saveAsApprovedConfirmation).setListener(presenter);

    when(displayProvider.get()).thenReturn(display);
    presenter.showData(currentPageRows);
  }
  @Test
  public void onUserConfigChangeEvent() {
    // Given: change default settings in config
    configHolder.setDisplayButtons(false);
    configHolder.setSpellCheckEnabled(false);

    // When:
    presenter.onUserConfigChanged(UserConfigChangeEvent.EDITOR_CONFIG_CHANGE_EVENT);

    // Then:
    verify(display, times(3)).showButtons(false);
    verify(saveAsApprovedConfirmation)
        .setShowSaveApprovedWarning(
            userOptionsService.getConfigHolder().getState().isShowSaveApprovedWarning());
    verify(display, times(3)).setEnableSpellCheck(false);
  }