test_class.declarator: routeListener
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private RouteListener routeListener;
test_class.type: RouteListener
test_class.var_name: routeListener
test_class.declarator: regionService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private RegionService regionService;
test_class.type: RegionService
test_class.var_name: regionService
test_class.declarator: locationService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private LocationService locationService;
test_class.type: LocationService
test_class.var_name: locationService
test_class.declarator: vehicleService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private VehicleService vehicleService;
test_class.type: VehicleService
test_class.var_name: vehicleService
test_class.declarator: demoService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private DemoService demoService;
test_class.type: DemoService
test_class.var_name: demoService
test_class.declarator: eventPublisher
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ApplicationEventPublisher eventPublisher;
test_class.type: ApplicationEventPublisher
test_class.var_name: eventPublisher
test_class.declarator: webSocketController
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private WebSocketController webSocketController;
test_class.type: WebSocketController
test_class.var_name: webSocketController
test_class.file: optaweb-vehicle-routing-backend/src/test/java/org/optaweb/vehiclerouting/plugin/websocket/WebSocketControllerTest.java
test_class.identifier: WebSocketControllerTest
test_case.body: @Test
      void subscribeToRouteTopic() {
          // arrange
          Distance distance = Distance.ofMillis(987_654_321);
          Location depot = new Location(1, Coordinates.valueOf(3, 5));
          Vehicle vehicle = VehicleFactory.createVehicle(1, "vehicle", 77);
          Location visit = new Location(2, Coordinates.valueOf(321, 123));
          Route route = new Route(vehicle, depot, singletonList(visit));
          Coordinates pointOnTrack = Coordinates.valueOf(0, 0);
          RouteWithTrack routeWithTrack = new RouteWithTrack(route, singletonList(singletonList(pointOnTrack)));
          RoutingPlan plan = new RoutingPlan(
                  distance,
                  singletonList(vehicle),
                  depot,
                  singletonList(visit),
                  singletonList(routeWithTrack));
          when(routeListener.getBestRoutingPlan()).thenReturn(plan);
  
          // act
          PortableRoutingPlan portableRoutingPlan = webSocketController.subscribeToRouteTopic();
  
          // assert
          assertThat(portableRoutingPlan.getDistance()).isEqualTo(PortableDistance.fromDistance(distance));
          assertThat(portableRoutingPlan.getVisits()).containsExactly(PortableLocation.fromLocation(visit));
          assertThat(portableRoutingPlan.getVehicles()).containsExactly(PortableVehicle.fromVehicle(vehicle));
          assertThat(portableRoutingPlan.getDepot()).isEqualTo(PortableLocation.fromLocation(depot));
          assertThat(portableRoutingPlan.getRoutes()).hasSize(1);
      }
test_case.class_method_signature: WebSocketControllerTest.subscribeToRouteTopic()
test_case.full_signature: @Test void subscribeToRouteTopic()
test_case.identifier: subscribeToRouteTopic
test_case.invocations: ofMillis valueOf createVehicle valueOf singletonList valueOf singletonList singletonList singletonList singletonList singletonList thenReturn when getBestRoutingPlan subscribeToRouteTopic isEqualTo assertThat getDistance fromDistance containsExactly assertThat getVisits fromLocation containsExactly assertThat getVehicles fromVehicle isEqualTo assertThat getDepot fromLocation hasSize assertThat getRoutes
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void subscribeToRouteTopic()
focal_class.declarator: logger = LoggerFactory.getLogger(WebSocketController.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(WebSocketController.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: routeListener
focal_class.modifier: private final
focal_class.original_string: private final RouteListener routeListener;
focal_class.type: RouteListener
focal_class.var_name: routeListener
focal_class.declarator: regionService
focal_class.modifier: private final
focal_class.original_string: private final RegionService regionService;
focal_class.type: RegionService
focal_class.var_name: regionService
focal_class.declarator: locationService
focal_class.modifier: private final
focal_class.original_string: private final LocationService locationService;
focal_class.type: LocationService
focal_class.var_name: locationService
focal_class.declarator: vehicleService
focal_class.modifier: private final
focal_class.original_string: private final VehicleService vehicleService;
focal_class.type: VehicleService
focal_class.var_name: vehicleService
focal_class.declarator: demoService
focal_class.modifier: private final
focal_class.original_string: private final DemoService demoService;
focal_class.type: DemoService
focal_class.var_name: demoService
focal_class.declarator: eventPublisher
focal_class.modifier: private final
focal_class.original_string: private final ApplicationEventPublisher eventPublisher;
focal_class.type: ApplicationEventPublisher
focal_class.var_name: eventPublisher
focal_class.file: optaweb-vehicle-routing-backend/src/main/java/org/optaweb/vehiclerouting/plugin/websocket/WebSocketController.java
focal_class.identifier: WebSocketController
focal_class.class_method_signature: WebSocketController.WebSocketController(
              RouteListener routeListener,
              RegionService regionService,
              LocationService locationService,
              VehicleService vehicleService,
              DemoService demoService,
              ApplicationEventPublisher eventPublisher)
focal_class.full_signature: @Autowired  WebSocketController(
              RouteListener routeListener,
              RegionService regionService,
              LocationService locationService,
              VehicleService vehicleService,
              DemoService demoService,
              ApplicationEventPublisher eventPublisher)
focal_class.identifier: WebSocketController
focal_class.modifiers: @Autowired
focal_class.parameters: (
              RouteListener routeListener,
              RegionService regionService,
              LocationService locationService,
              VehicleService vehicleService,
              DemoService demoService,
              ApplicationEventPublisher eventPublisher)
focal_class.signature:  WebSocketController(
              RouteListener routeListener,
              RegionService regionService,
              LocationService locationService,
              VehicleService vehicleService,
              DemoService demoService,
              ApplicationEventPublisher eventPublisher)
focal_class.class_method_signature: WebSocketController.handleException(Exception exception)
focal_class.full_signature: @MessageExceptionHandler void handleException(Exception exception)
focal_class.identifier: handleException
focal_class.modifiers: @MessageExceptionHandler
focal_class.parameters: (Exception exception)
focal_class.return: void
focal_class.signature: void handleException(Exception exception)
focal_class.class_method_signature: WebSocketController.subscribeToServerInfoTopic()
focal_class.full_signature: @SubscribeMapping("/serverInfo") ServerInfo subscribeToServerInfoTopic()
focal_class.identifier: subscribeToServerInfoTopic
focal_class.modifiers: @SubscribeMapping("/serverInfo")
focal_class.parameters: ()
focal_class.return: ServerInfo
focal_class.signature: ServerInfo subscribeToServerInfoTopic()
focal_class.class_method_signature: WebSocketController.subscribeToRouteTopic()
focal_class.full_signature: @SubscribeMapping("/route") PortableRoutingPlan subscribeToRouteTopic()
focal_class.identifier: subscribeToRouteTopic
focal_class.modifiers: @SubscribeMapping("/route")
focal_class.parameters: ()
focal_class.return: PortableRoutingPlan
focal_class.signature: PortableRoutingPlan subscribeToRouteTopic()
focal_class.class_method_signature: WebSocketController.addLocation(PortableLocation request)
focal_class.full_signature: @MessageMapping("/location") void addLocation(PortableLocation request)
focal_class.identifier: addLocation
focal_class.modifiers: @MessageMapping("/location")
focal_class.parameters: (PortableLocation request)
focal_class.return: void
focal_class.signature: void addLocation(PortableLocation request)
focal_class.class_method_signature: WebSocketController.removeLocation(@DestinationVariable long id)
focal_class.full_signature: @MessageMapping("/location/{id}/delete") void removeLocation(@DestinationVariable long id)
focal_class.identifier: removeLocation
focal_class.modifiers: @MessageMapping("/location/{id}/delete")
focal_class.parameters: (@DestinationVariable long id)
focal_class.return: void
focal_class.signature: void removeLocation(@DestinationVariable long id)
focal_class.class_method_signature: WebSocketController.demo(@DestinationVariable String name)
focal_class.full_signature: @MessageMapping("/demo/{name}") void demo(@DestinationVariable String name)
focal_class.identifier: demo
focal_class.modifiers: @MessageMapping("/demo/{name}")
focal_class.parameters: (@DestinationVariable String name)
focal_class.return: void
focal_class.signature: void demo(@DestinationVariable String name)
focal_class.class_method_signature: WebSocketController.clear()
focal_class.full_signature: @MessageMapping("/clear") void clear()
focal_class.identifier: clear
focal_class.modifiers: @MessageMapping("/clear")
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clear()
focal_class.class_method_signature: WebSocketController.addVehicle()
focal_class.full_signature: @MessageMapping("vehicle") void addVehicle()
focal_class.identifier: addVehicle
focal_class.modifiers: @MessageMapping("vehicle")
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void addVehicle()
focal_class.class_method_signature: WebSocketController.removeVehicle(@DestinationVariable long id)
focal_class.full_signature: @MessageMapping("/vehicle/{id}/delete") void removeVehicle(@DestinationVariable long id)
focal_class.identifier: removeVehicle
focal_class.modifiers: @MessageMapping("/vehicle/{id}/delete")
focal_class.parameters: (@DestinationVariable long id)
focal_class.return: void
focal_class.signature: void removeVehicle(@DestinationVariable long id)
focal_class.class_method_signature: WebSocketController.removeAnyVehicle()
focal_class.full_signature: @MessageMapping("/vehicle/deleteAny") void removeAnyVehicle()
focal_class.identifier: removeAnyVehicle
focal_class.modifiers: @MessageMapping("/vehicle/deleteAny")
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void removeAnyVehicle()
focal_class.class_method_signature: WebSocketController.changeCapacity(@DestinationVariable long id, int capacity)
focal_class.full_signature: @MessageMapping("/vehicle/{id}/capacity") void changeCapacity(@DestinationVariable long id, int capacity)
focal_class.identifier: changeCapacity
focal_class.modifiers: @MessageMapping("/vehicle/{id}/capacity")
focal_class.parameters: (@DestinationVariable long id, int capacity)
focal_class.return: void
focal_class.signature: void changeCapacity(@DestinationVariable long id, int capacity)
focal_method.body: @SubscribeMapping("/route")
      PortableRoutingPlan subscribeToRouteTopic() {
          RoutingPlan routingPlan = routeListener.getBestRoutingPlan();
          return PortableRoutingPlanFactory.fromRoutingPlan(routingPlan);
      }
focal_method.class_method_signature: WebSocketController.subscribeToRouteTopic()
focal_method.full_signature: @SubscribeMapping("/route") PortableRoutingPlan subscribeToRouteTopic()
focal_method.identifier: subscribeToRouteTopic
focal_method.invocations: getBestRoutingPlan fromRoutingPlan
focal_method.modifiers: @SubscribeMapping("/route")
focal_method.parameters: ()
focal_method.return: PortableRoutingPlan
focal_method.signature: PortableRoutingPlan subscribeToRouteTopic()