use of com.gitblit.tickets.TicketNotifier in project gitblit by gitblit.
the class TicketServiceTest method testNotifier.
@Test
public void testNotifier() throws Exception {
Change kernel = new Change("james");
kernel.setField(Field.title, "Sample ticket");
kernel.setField(Field.body, "this **is** my sample body\n\n- I hope\n- you really\n- *really* like it");
kernel.setField(Field.status, Status.New);
kernel.setField(Field.type, Type.Proposal);
kernel.comment("this is a sample comment on a kernel change");
Patchset patchset = new Patchset();
patchset.insertions = 100;
patchset.deletions = 10;
patchset.number = 1;
patchset.rev = 25;
patchset.tip = "50f57913f816d04a16b7407134de5d8406421f37";
kernel.patchset = patchset;
TicketModel ticket = service.createTicket(getRepository(), 0L, kernel);
Change merge = new Change("james");
merge.setField(Field.mergeSha, patchset.tip);
merge.setField(Field.mergeTo, "master");
merge.setField(Field.status, Status.Merged);
ticket = service.updateTicket(getRepository(), ticket.number, merge);
ticket.repository = getRepository().name;
TicketNotifier notifier = service.createNotifier();
Mailing mailing = notifier.queueMailing(ticket);
assertNotNull(mailing);
}
Aggregations