PubsubEventModule extends AbstractModule { public static void bindSubscriber(Binder binder, Class<? extends EventSubscriber> subscriber) { getSubscriberBinder(binder).addBinding().to(subscriber); } @VisibleForTesting  PubsubEventModule(Logger log);  PubsubEventModule(); static LinkedBindingBuilder<SchedulingFilter> bindSchedulingFilterDelegate(Binder binder); static void bind(Binder binder); static void bindSubscriber(Binder binder, Class<? extends EventSubscriber> subscriber);  }
@Test public void testPubsubExceptionTracking() throws Exception { logger.error(anyString(), EasyMock.<Throwable>anyObject()); control.replay(); Injector injector = getInjector( new AbstractModule() { @Override protected void configure() { PubsubEventModule.bindSubscriber(binder(), ThrowingSubscriber.class); } }); injector.getInstance(Key.get(GuavaUtils.ServiceManagerIface.class, AppStartup.class)) .startAsync().awaitHealthy(); assertEquals(0L, statsProvider.getLongValue(PubsubEventModule.EXCEPTIONS_STAT)); injector.getInstance(EventBus.class).post("hello"); assertEquals(1L, statsProvider.getLongValue(PubsubEventModule.EXCEPTIONS_STAT)); }