@Test
void subscribeToServerInfo() {

    // arrange
    List<String> countryCodes = Arrays.asList("XY", "WZ");
    when(regionService.countryCodes()).thenReturn(countryCodes);
    Coordinates southWest = Coordinates.valueOf(-1.0, -2.0);
    Coordinates northEast = Coordinates.valueOf(1.0, 2.0);
    BoundingBox boundingBox = new BoundingBox(southWest, northEast);
    when(regionService.boundingBox()).thenReturn(boundingBox);
    Location depot = new Location(1, Coordinates.valueOf(1.0, 7), "Depot");
    List<Location> visits = Arrays.asList(new Location(2, Coordinates.valueOf(2.0, 9), "Visit"));
    List<Vehicle> vehicles = Arrays.asList(VehicleFactory.testVehicle(1));
    String demoName = "Testing problem";
    RoutingProblem routingProblem = new RoutingProblem(demoName, vehicles, depot, visits);
    when(demoService.demos()).thenReturn(Arrays.asList(routingProblem));
    // act
    ServerInfo serverInfo = webSocketController.subscribeToServerInfoTopic();
    // assert
    assertThat(serverInfo.getCountryCodes()).isEqualTo(countryCodes);
    assertThat(serverInfo.getBoundingBox()).containsExactly(
            PortableCoordinates.fromCoordinates(southWest),
            PortableCoordinates.fromCoordinates(northEast));
    List<RoutingProblemInfo> demos = serverInfo.getDemos();
    assertThat(demos).hasSize(1);
    RoutingProblemInfo demo = demos.get(0);
    assertThat(demo.getName()).isEqualTo(demoName);
    assertThat(demo.getVisits()).isEqualTo(visits.size());
}