HolmesService implements Service { @Subscribe public void handleDeadEvent(final DeadEvent deadEvent) { LOGGER.warn("Event not handled: {}", deadEvent.getEvent().toString()); } @Inject  HolmesService(@Named("http") final Service httpService, @Named("upnp") final Service upnpService, @Named("airplay") final Service airplayService,
                         @Named("systray") final Service systrayService, @Named("release") final Service releaseCheckService,
                         @Named("localHolmesDataDir") final String localHolmesDataDir); @Override void start(); @Override void stop(); @Subscribe void handleDeadEvent(final DeadEvent deadEvent);  }
@Test public void tesHandleDeadEvent() { Service service = createMock(Service.class); DeadEvent deadEvent = createMock(DeadEvent.class); expect(deadEvent.getEvent()).andReturn(""); replay(service, deadEvent); HolmesService holmesService = new HolmesService(service, service, service, service, service, System.getProperty("java.io.tmpdir")); holmesService.handleDeadEvent(deadEvent); verify(service, deadEvent); }