assertNotNull(ReporterUtils.prepareMessagePrefix(sbm));
assertEquals("cat ", ReporterUtils.prepareMessagePrefix(sbm));
}
public void testPrepareWithEmptyMessagePrefix() {
Submit sbm = prepareDuplicatesData();
assertNotNull(ReporterUtils.prepareMessagePrefix(sbm));
assertEquals("", ReporterUtils.prepareMessagePrefix(sbm));
MockSubmit dup1 = (MockSubmit) sbm.getDuplicates().iterator().next();
dup1.setReporter(new Submit.Reporter("user2", true, ""));
assertNotNull(ReporterUtils.prepareMessagePrefix(sbm));
assertEquals("Ignore empty prefix", "", ReporterUtils.prepareMessagePrefix(sbm));
List<Submit> duplicates = (List)sbm.getDuplicates();
MockSubmit du = (MockSubmit) duplicates.get(duplicates.size() - 1);
du.setReporter(new Submit.Reporter("user9", true, "cat"));
assertNotNull(ReporterUtils.prepareMessagePrefix(sbm));
assertEquals("cat ", ReporterUtils.prepareMessagePrefix(sbm));