* @param date The patchset's createdOn date
* @return ChangeMerged mock.
*/
public static ChangeMerged createChangeMergedWithPatchSetDate(String serverName, String project,
String ref, Date date) {
ChangeMerged event = new ChangeMerged();
Change change = new Change();
change.setBranch("branch");
change.setId("Iddaaddaa123456789");
change.setNumber("1000");
Account account = new Account();
account.setEmail("email@domain.com");
account.setName("Name");
change.setOwner(account);
change.setProject(project);
change.setSubject("subject");
change.setUrl("http://gerrit/1000");
event.setChange(change);
PatchSet patch = new PatchSet();
patch.setNumber("1");
patch.setRevision("9999");
event.setPatchset(patch);
patch.setRef(ref);
patch.setCreatedOn(date);
event.setProvider(new Provider(serverName, "gerrit", "29418", "ssh", "http://gerrit/", "1"));
return event;
}