@Test public void should_send_event_to_dispatcher() throws Exception { commitRequestedSubscriber.accept(commitRequestedEvent); verify(nsqDispatcher).sendCommitRequested(commitRequestedEvent, "hap", "app", "ptf", "bind"); }
@Override public void accept(CommitRequestedEvent commitRequestedEvent) { EntryPoint configuration = commitRequestedEvent.getConfiguration(); Map<String, String> context = configuration.getContext(); Optional.ofNullable(context.get("application")).ifPresent(application -> Optional.ofNullable(context.get("platform")).ifPresent(platform -> { try { nsqDispatcher.sendCommitRequested(commitRequestedEvent, configuration.getHaproxy(), application, platform, commitRequestedEvent.getBind()); } catch (Exception e) { LOGGER.error("Unable to send commit requested event {} to NSQ because of the following errors", commitRequestedEvent, e); } })); }
CommitRequestedSubscriber implements Consumer<CommitRequestedEvent> { @Override public void accept(CommitRequestedEvent commitRequestedEvent) { EntryPoint configuration = commitRequestedEvent.getConfiguration(); Map<String, String> context = configuration.getContext(); Optional.ofNullable(context.get("application")).ifPresent(application -> Optional.ofNullable(context.get("platform")).ifPresent(platform -> { try { nsqDispatcher.sendCommitRequested(commitRequestedEvent, configuration.getHaproxy(), application, platform, commitRequestedEvent.getBind()); } catch (Exception e) { LOGGER.error("Unable to send commit requested event {} to NSQ because of the following errors", commitRequestedEvent, e); } })); } }
CommitRequestedSubscriber implements Consumer<CommitRequestedEvent> { @Override public void accept(CommitRequestedEvent commitRequestedEvent) { EntryPoint configuration = commitRequestedEvent.getConfiguration(); Map<String, String> context = configuration.getContext(); Optional.ofNullable(context.get("application")).ifPresent(application -> Optional.ofNullable(context.get("platform")).ifPresent(platform -> { try { nsqDispatcher.sendCommitRequested(commitRequestedEvent, configuration.getHaproxy(), application, platform, commitRequestedEvent.getBind()); } catch (Exception e) { LOGGER.error("Unable to send commit requested event {} to NSQ because of the following errors", commitRequestedEvent, e); } })); } CommitRequestedSubscriber(NSQDispatcher nsqDispatcher); }
CommitRequestedSubscriber implements Consumer<CommitRequestedEvent> { @Override public void accept(CommitRequestedEvent commitRequestedEvent) { EntryPoint configuration = commitRequestedEvent.getConfiguration(); Map<String, String> context = configuration.getContext(); Optional.ofNullable(context.get("application")).ifPresent(application -> Optional.ofNullable(context.get("platform")).ifPresent(platform -> { try { nsqDispatcher.sendCommitRequested(commitRequestedEvent, configuration.getHaproxy(), application, platform, commitRequestedEvent.getBind()); } catch (Exception e) { LOGGER.error("Unable to send commit requested event {} to NSQ because of the following errors", commitRequestedEvent, e); } })); } CommitRequestedSubscriber(NSQDispatcher nsqDispatcher); @Override void accept(CommitRequestedEvent commitRequestedEvent); }
CommitRequestedSubscriber implements Consumer<CommitRequestedEvent> { @Override public void accept(CommitRequestedEvent commitRequestedEvent) { EntryPoint configuration = commitRequestedEvent.getConfiguration(); Map<String, String> context = configuration.getContext(); Optional.ofNullable(context.get("application")).ifPresent(application -> Optional.ofNullable(context.get("platform")).ifPresent(platform -> { try { nsqDispatcher.sendCommitRequested(commitRequestedEvent, configuration.getHaproxy(), application, platform, commitRequestedEvent.getBind()); } catch (Exception e) { LOGGER.error("Unable to send commit requested event {} to NSQ because of the following errors", commitRequestedEvent, e); } })); } CommitRequestedSubscriber(NSQDispatcher nsqDispatcher); @Override void accept(CommitRequestedEvent commitRequestedEvent);  }