public void testExecute() throws Exception {
List<TransUnitUpdateInfo> updatesToRevert =
Lists.newArrayList(new TransUnitUpdateInfo(true, true,
new DocumentId(new Long(1), ""), TestFixture
.makeTransUnit(1), 0, 0, ContentState.Approved));
RevertTransUnitUpdates action =
new RevertTransUnitUpdates(updatesToRevert);
action.setWorkspaceId(new WorkspaceId(new ProjectIterationId("", "",
ProjectType.File), LocaleId.EN_US));
TranslationService.TranslationResult translationResult =
mockTranslationResult(ContentState.NeedReview, 0);
when(
translationServiceImpl.revertTranslations(LocaleId.EN_US,
action.getUpdatesToRevert())).thenReturn(
Lists.newArrayList(translationResult));
UpdateTransUnitResult result = handler.execute(action, null);
assertThat(result.getUpdateInfoList(), Matchers.hasSize(1));