fromHeader.setComment(new HSimpleComment("initial comment"));
String expectedComment =
"initial comment\n"
+ "Alice <alice@example.org>, 2010. #zanata\n"
+ "Alice <alice@example.org>, 2011. #zanata";
PoTargetHeader toHeader = new PoTargetHeader();
HPerson alice = new HPerson();
alice.setName("Alice");
alice.setEmail("alice@example.org");
List<HTextFlowTarget> hTargets = new ArrayList<HTextFlowTarget>();
HTextFlowTarget tft1 = new HTextFlowTarget();
tft1.setLastChanged(new Date(1302671654000L)); // 13 Apr 2011
tft1.setLastModifiedBy(alice);
hTargets.add(tft1);
HTextFlowTarget tft2 = new HTextFlowTarget();
tft2.setLastChanged(new Date(1304329523000L)); // 2 May 2011
tft2.setLastModifiedBy(alice);
hTargets.add(tft2);
HTextFlowTarget tft3 = new HTextFlowTarget();
tft3.setLastChanged(new Date(1262419384000L)); // 2 Jan 2010
tft3.setLastModifiedBy(alice);
hTargets.add(tft3);
resourceUtils.pullPoTargetComment(fromHeader, toHeader, hTargets);
assertThat("", toHeader.getComment(), is(expectedComment));
}