FixedValueMaker.EMPTY_STRING_MAKER)
.reuseEntity(hLocale).build()
.makeAndPersist(getEm(), HDocument.class);
documentId = new DocumentId(hDocument.getId(), hDocument.getDocId());
HTextFlowBuilder baseBuilder =
new HTextFlowBuilder().withDocument(hDocument)
.withTargetLocale(hLocale);
HTextFlowBuilder adminModifiedToday =
baseBuilder.withLastModifiedDate(today).withLastModifiedBy(
admin);
// make 10 text flows and some text flow targets
// 1. null target
baseBuilder.withResId("res1").withSourceContent("source 1").build();
// target translated by admin on today
// 2. translated target
adminModifiedToday.withResId("res2").withSourceContent("source 2")
.withTargetContent("target 2")
.withTargetState(ContentState.Translated).build();
// 3. fuzzy target
adminModifiedToday.withResId("res3").withSourceContent("source 3")
.withTargetContent("target 3")
.withTargetState(ContentState.NeedReview).build();
// 4. untranslated target but is not null
adminModifiedToday.withResId("res4").withSourceContent("source 4")
.withTargetContent("").withTargetState(ContentState.New)
.build();
// 5. target with comment
adminModifiedToday.withResId("res5").withSourceContent("source 5")
.withTargetContent("target 5")
.withTargetState(ContentState.Translated)
.withTargetComment("target comment").build();
// 6. source with msgContext
adminModifiedToday.withResId("res6").withSourceContent("source 6")
.withMsgContext(",gettext ,fuzzy").build();
// 7. source with comment
adminModifiedToday.withResId("res7").withSourceContent("source 7")
.withSourceComment("source comment").build();
// 8. target translated by admin on yesterday
baseBuilder.withLastModifiedDate(yesterday).withLastModifiedBy(admin)
.withResId("res8").withSourceContent("source 8")