AMQPBusPublisher implements EventListener { public void close() { Util.closeSafely(sender, "QpidConnection"); } @Inject  AMQPBusPublisher(ObjectMapper omapper, QpidConnection sender); @Override void onEvent(Event e); @Override boolean requiresQpid(); void close(); String apply(Event event);  }
@Test public void testClose() throws JMSException { publisher.close(); verify(qpid).close(); }