@Test void testCallsTelemetryAgentService() { List<String> instanceIds = List.of("i-1"); StopTelemetryRequest request = new StopTelemetryRequest(1L, instanceIds); underTest.accept(new Event<>(request)); verify(telemetryAgentService, times(1)).stopTelemetryAgent(1L, instanceIds); verify(eventBus).notify(eq("STOPTELEMETRYRESPONSE"), ArgumentMatchers.<Event>any()); }
@Override public void accept(Event<StopTelemetryRequest> event) { StopTelemetryRequest request = event.getData(); LOGGER.info("Stop telemetry agents gracefully (if needed)..."); telemetryAgentService.stopTelemetryAgent(request.getResourceId(), request.getInstanceIds()); StopTelemetryResponse response = new StopTelemetryResponse(request.getResourceId()); eventBus.notify(EventSelectorUtil.selector(StopTelemetryResponse.class), new Event<>(event.getHeaders(), response)); }
StopTelemetryHandler implements EventHandler<StopTelemetryRequest> { @Override public void accept(Event<StopTelemetryRequest> event) { StopTelemetryRequest request = event.getData(); LOGGER.info("Stop telemetry agents gracefully (if needed)..."); telemetryAgentService.stopTelemetryAgent(request.getResourceId(), request.getInstanceIds()); StopTelemetryResponse response = new StopTelemetryResponse(request.getResourceId()); eventBus.notify(EventSelectorUtil.selector(StopTelemetryResponse.class), new Event<>(event.getHeaders(), response)); } }
StopTelemetryHandler implements EventHandler<StopTelemetryRequest> { @Override public void accept(Event<StopTelemetryRequest> event) { StopTelemetryRequest request = event.getData(); LOGGER.info("Stop telemetry agents gracefully (if needed)..."); telemetryAgentService.stopTelemetryAgent(request.getResourceId(), request.getInstanceIds()); StopTelemetryResponse response = new StopTelemetryResponse(request.getResourceId()); eventBus.notify(EventSelectorUtil.selector(StopTelemetryResponse.class), new Event<>(event.getHeaders(), response)); }  }
StopTelemetryHandler implements EventHandler<StopTelemetryRequest> { @Override public void accept(Event<StopTelemetryRequest> event) { StopTelemetryRequest request = event.getData(); LOGGER.info("Stop telemetry agents gracefully (if needed)..."); telemetryAgentService.stopTelemetryAgent(request.getResourceId(), request.getInstanceIds()); StopTelemetryResponse response = new StopTelemetryResponse(request.getResourceId()); eventBus.notify(EventSelectorUtil.selector(StopTelemetryResponse.class), new Event<>(event.getHeaders(), response)); }  @Override String selector(); @Override void accept(Event<StopTelemetryRequest> event); }
StopTelemetryHandler implements EventHandler<StopTelemetryRequest> { @Override public void accept(Event<StopTelemetryRequest> event) { StopTelemetryRequest request = event.getData(); LOGGER.info("Stop telemetry agents gracefully (if needed)..."); telemetryAgentService.stopTelemetryAgent(request.getResourceId(), request.getInstanceIds()); StopTelemetryResponse response = new StopTelemetryResponse(request.getResourceId()); eventBus.notify(EventSelectorUtil.selector(StopTelemetryResponse.class), new Event<>(event.getHeaders(), response)); }  @Override String selector(); @Override void accept(Event<StopTelemetryRequest> event);  }