use of org.motechproject.event.listener.annotations.MotechListenerEventProxy in project motech by motech.
the class TaskTriggerHandlerTest method shouldRegisterRetryHandlerForSubject.
@Test
public void shouldRegisterRetryHandlerForSubject() {
String subject = "org.motechproject.messagecampaign.campaign-completed";
handler.registerHandlerFor(subject, true);
ArgumentCaptor<EventListener> captor = ArgumentCaptor.forClass(EventListener.class);
verify(registryService).registerListener(captor.capture(), eq(subject));
MotechListenerEventProxy proxy = (MotechListenerEventProxy) captor.getValue();
assertEquals("taskTriggerHandler", proxy.getIdentifier());
assertEquals(handler, proxy.getBean());
assertEquals(findMethod(getTargetClass(handler), "handleRetry", MotechEvent.class), proxy.getMethod());
}
use of org.motechproject.event.listener.annotations.MotechListenerEventProxy in project motech by motech.
the class TaskTriggerHandlerTest method shouldRegisterHandlerForSubject.
@Test
public void shouldRegisterHandlerForSubject() {
String subject = "org.motechproject.messagecampaign.campaign-completed";
handler.registerHandlerFor(subject);
ArgumentCaptor<EventListener> captor = ArgumentCaptor.forClass(EventListener.class);
verify(registryService).registerListener(captor.capture(), eq(subject));
MotechListenerEventProxy proxy = (MotechListenerEventProxy) captor.getValue();
assertEquals("taskTriggerHandler", proxy.getIdentifier());
assertEquals(handler, proxy.getBean());
assertEquals(findMethod(getTargetClass(handler), "handle", MotechEvent.class), proxy.getMethod());
}
Aggregations