AsyncEmailSender extends AbstractSender { @PostConstruct public void initListeners() { callbackFunction = new EmailSendErrorReporter(); }  @Override String getId(); @PostConstruct void initListeners(); @Override boolean send(AlertMessageEntity message); @VisibleForTesting AsyncEmailSenderCallback getCallbackFunction(); static final String ID; }
@Test public void testInitListeners() throws Exception { AsyncEmailSenderCallback callbackFunction = sender.getCallbackFunction(); Assert.assertNotNull(callbackFunction); Assert.assertTrue(callbackFunction instanceof CompositeEmailSenderCallback); List<AsyncEmailSenderCallback> callbacks = ((CompositeEmailSenderCallback) callbackFunction).getCallbacks(); logger.info("{}", callbacks); }