when(
localeService.validateLocaleByProjectIteration(localeId,
"rhel", "7.0")).thenReturn(hLocale);
when(hLocale.getId()).thenReturn(2L);
HTextFlow hTextFlow = createHTextFlow();
HTextFlowTarget currentTranslation =
createTarget(new Date(), null, 0,
new HashMap<Integer, HTextFlowTargetHistory>());
currentTranslation.setLastModifiedBy(null);
hTextFlow.getTargets().put(hLocale.getId(), currentTranslation);
when(resourceUtils.getNumPlurals(hTextFlow.getDocument(), hLocale))
.thenReturn(2);
when(textFlowDAO.findById(transUnitId.getId(), false)).thenReturn(
hTextFlow);
// When:
GetTranslationHistoryResult result =
handler.execute(action, executionContext);
// Then:
assertThat(result.getHistoryItems(),
Matchers.<TransHistoryItem> emptyIterable());
assertThat(result.getLatest().getVersionNum(),
Matchers.equalTo(currentTranslation.getVersionNum().toString()));
assertThat(result.getLatest().getContents(),
Matchers.equalTo(currentTranslation.getContents()));
assertThat(result.getLatest().getModifiedBy(), Matchers.equalTo(""));
}