WebSocketController { @MessageExceptionHandler void handleException(Exception exception) { logger.error("Uncaught exception", exception); eventPublisher.publishEvent(new ErrorEvent(this, exception.toString())); } @Autowired  WebSocketController(
            RouteListener routeListener,
            RegionService regionService,
            LocationService locationService,
            VehicleService vehicleService,
            DemoService demoService,
            ApplicationEventPublisher eventPublisher);   }
@Test void exception_handler_should_publish_error_event() { webSocketController.handleException(new Exception("test exception")); verify(eventPublisher).publishEvent(any(ErrorEvent.class)); }