<commit_before>package org.zanata.webtrans.client.presenter;

import java.util.List;

import org.hamcrest.Matchers;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import org.zanata.model.TestFixture;
import org.zanata.webtrans.client.events.NavTransUnitEvent;
import org.zanata.webtrans.client.events.WorkspaceContextUpdateEvent;
import org.zanata.webtrans.client.keys.KeyShortcut;
import org.zanata.webtrans.client.keys.Keys;
import org.zanata.webtrans.client.keys.ShortcutContext;
import org.zanata.webtrans.client.resources.WebTransMessages;
import org.zanata.webtrans.client.service.NavigationService;
import org.zanata.webtrans.shared.model.TransUnit;
import org.zanata.webtrans.shared.model.UserWorkspaceContext;
import com.google.gwt.event.dom.client.KeyCodes;

import net.customware.gwt.presenter.client.EventBus;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;

/**
 * @author <NAME> <a href="mailto:<EMAIL>"><EMAIL></a>
 */
@Test(groups = { "unit-tests" })
public class TranslationPresenterTest
{
   private TranslationPresenter presenter;
   @Mock
   private TranslationPresenter.Display display;
   @Mock
   private EventBus eventBus;
   @Mock
   private TargetContentsPresenter targetContentsPresenter;
   @Mock
   private TranslationEditorPresenter translationEditorPresenter;
   @Mock
   private TransMemoryPresenter transMemoryPresenter;
   @Mock
   private GlossaryPresenter glossaryPresenter;
   @Mock
   private WebTransMessages messages;
   private UserWorkspaceContext userWorkspaceContext;
   @Mock
   private KeyShortcutPresenter keyShortcutPresenter;
   @Mock
   private NavigationService navigationService;
   @Captor
   private ArgumentCaptor<KeyShortcut> keyShortcutCaptor;
   @Mock
   private TranslationEditorPresenter.Display translationEditorDisplay;

   @BeforeMethod
   public void beforeMethod()
   {
      MockitoAnnotations.initMocks(this);
      userWorkspaceContext = TestFixture.userWorkspaceContext();
      presenter = new TranslationPresenter(display, eventBus, targetContentsPresenter, translationEditorPresenter, transMemoryPresenter, glossaryPresenter, messages, userWorkspaceContext, keyShortcutPresenter, navigationService);
   }

   @Test
   public void onRevealDisplay()
   {
      presenter.onRevealDisplay();

      verify(targetContentsPresenter).concealDisplay();
      verify(keyShortcutPresenter).setContextActive(ShortcutContext.Navigation, true);
   }
<commit_msg>fix test<commit_after>package org.zanata.webtrans.client.presenter;

import java.util.List;

import org.hamcrest.Matchers;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import org.zanata.model.TestFixture;
import org.zanata.webtrans.client.events.NavTransUnitEvent;
import org.zanata.webtrans.client.events.WorkspaceContextUpdateEvent;
import org.zanata.webtrans.client.keys.KeyShortcut;
import org.zanata.webtrans.client.keys.Keys;
import org.zanata.webtrans.client.keys.ShortcutContext;
import org.zanata.webtrans.client.resources.WebTransMessages;
import org.zanata.webtrans.client.service.NavigationService;
import org.zanata.webtrans.shared.model.TransUnit;
import org.zanata.webtrans.shared.model.UserWorkspaceContext;
import com.google.gwt.event.dom.client.KeyCodes;

import net.customware.gwt.presenter.client.EventBus;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;

/**
 * @author <NAME> <a href="mailto:<EMAIL>"><EMAIL></a>
 */
@Test(groups = { "unit-tests" })
public class TranslationPresenterTest
{
   private TranslationPresenter presenter;
   @Mock
   private TranslationPresenter.Display display;
   @Mock
   private EventBus eventBus;
   @Mock
   private TargetContentsPresenter targetContentsPresenter;
   @Mock
   private TranslationEditorPresenter translationEditorPresenter;
   @Mock
   private TransMemoryPresenter transMemoryPresenter;
   @Mock
   private GlossaryPresenter glossaryPresenter;
   @Mock
   private WebTransMessages messages;
   private UserWorkspaceContext userWorkspaceContext;
   @Mock
   private KeyShortcutPresenter keyShortcutPresenter;
   @Mock
   private NavigationService navigationService;
   @Captor
   private ArgumentCaptor<KeyShortcut> keyShortcutCaptor;
   @Mock
   private TranslationEditorPresenter.Display translationEditorDisplay;

   @BeforeMethod
   public void beforeMethod()
   {
      MockitoAnnotations.initMocks(this);
      userWorkspaceContext = TestFixture.userWorkspaceContext();
      presenter = new TranslationPresenter(display, eventBus, targetContentsPresenter, translationEditorPresenter, transMemoryPresenter, glossaryPresenter, messages, userWorkspaceContext, keyShortcutPresenter, navigationService);
   }

   @Test
   public void onRevealDisplay()
   {
      presenter.onRevealDisplay();

      verify(targetContentsPresenter).concealDisplay();
   }

{'fraction_non_alphanumeric': 0.08543226684819605, 'fraction_numerical': 0.0, 'mean_word_length': 5.817865429234339, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4632120', 'n_tokens_mistral': 1754, 'n_tokens_neox': 1723, 'n_words': 315}