@Test public void handleShouldSelectHandlerBasedOnEventType() { CloudTaskCreatedEvent event = new CloudTaskCreatedEventImpl(); context.handle(event); verify(handler).handle(event); }
public void handle(CloudRuntimeEvent<?, ?>... events) { if (events != null) { for (CloudRuntimeEvent<?, ?> event : events) { QueryEventHandler handler = handlers.get(event.getEventType().name()); if (handler != null) { LOGGER.debug("Handling event: " + handler.getHandledEvent()); handler.handle(event); } else { LOGGER.info("No handler found for event: " + event.getEventType().name() + ". Ignoring event"); } } } }
QueryEventHandlerContext { public void handle(CloudRuntimeEvent<?, ?>... events) { if (events != null) { for (CloudRuntimeEvent<?, ?> event : events) { QueryEventHandler handler = handlers.get(event.getEventType().name()); if (handler != null) { LOGGER.debug("Handling event: " + handler.getHandledEvent()); handler.handle(event); } else { LOGGER.info("No handler found for event: " + event.getEventType().name() + ". Ignoring event"); } } } } }
QueryEventHandlerContext { public void handle(CloudRuntimeEvent<?, ?>... events) { if (events != null) { for (CloudRuntimeEvent<?, ?> event : events) { QueryEventHandler handler = handlers.get(event.getEventType().name()); if (handler != null) { LOGGER.debug("Handling event: " + handler.getHandledEvent()); handler.handle(event); } else { LOGGER.info("No handler found for event: " + event.getEventType().name() + ". Ignoring event"); } } } } QueryEventHandlerContext(Set<QueryEventHandler> handlers); }
QueryEventHandlerContext { public void handle(CloudRuntimeEvent<?, ?>... events) { if (events != null) { for (CloudRuntimeEvent<?, ?> event : events) { QueryEventHandler handler = handlers.get(event.getEventType().name()); if (handler != null) { LOGGER.debug("Handling event: " + handler.getHandledEvent()); handler.handle(event); } else { LOGGER.info("No handler found for event: " + event.getEventType().name() + ". Ignoring event"); } } } } QueryEventHandlerContext(Set<QueryEventHandler> handlers); void handle(CloudRuntimeEvent<?, ?>... events); }
QueryEventHandlerContext { public void handle(CloudRuntimeEvent<?, ?>... events) { if (events != null) { for (CloudRuntimeEvent<?, ?> event : events) { QueryEventHandler handler = handlers.get(event.getEventType().name()); if (handler != null) { LOGGER.debug("Handling event: " + handler.getHandledEvent()); handler.handle(event); } else { LOGGER.info("No handler found for event: " + event.getEventType().name() + ". Ignoring event"); } } } } QueryEventHandlerContext(Set<QueryEventHandler> handlers); void handle(CloudRuntimeEvent<?, ?>... events);  }