@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);
}