@Test
public void getContactPaths() throws Exception {

    server.enqueue(new MockResponse().setBody("{\n"
          + "  \"contact_paths\": {\n"
          + "    \"paths\": [\n"
          + "      {\n"
          + "        \"users\": [\n"
          + "          {\n"
          + "            \"permalink\": \"https://www.xing.com/profile/John_Doe\",\n"
          + "            \"id\": \"3228492_861e68\",\n"
          + "            \"gender\": \"m\",\n"
          + "            \"display_name\": \"John Doe\"\n"
          + "          },\n"
          + "          {\n"
          + "            \"permalink\": \"https://www.xing.com/profile/Alex_Kaemper\",\n"
          + "            \"id\": \"1160_5fb1b2\",\n"
          + "            \"gender\": \"m\",\n"
          + "            \"display_name\": \"Alex Kämper\"\n"
          + "          },\n"
          + "          {\n"
          + "            \"permalink\": \"https://www.xing.com/profile/Mark_Fugazi\",\n"
          + "            \"id\": \"3647111_82d2c2\",\n"
          + "            \"gender\": \"m\",\n"
          + "            \"display_name\": \"Mark Fugazi\"\n"
          + "          },\n"
          + "          {\n"
          + "            \"permalink\": \"https://www.xing.com/profile/Max_Mustermann\",\n"
          + "            \"id\": \"3644173_68b1ee\",\n"
          + "            \"gender\": \"m\",\n"
          + "            \"display_name\": \"Max Mustermann\"\n"
          + "          }\n"
          + "        ]\n"
          + "      }\n"
          + "    ],\n"
          + "    \"distance\": 3,\n"
          + "    \"total\": 1\n"
          + "  }\n"
          + '}'));
    Response<ContactPaths, HttpError> response = resource.getContactPaths("firstId", "secondId").execute();
    // If no exception was thrown then the spec is build correctly.
    ContactPaths paths = response.body();
    assertThat(paths.getPaths().size()).isEqualTo(1);
    assertThat(paths.getPaths().get(0).size()).isEqualTo(4);
    assertThat(paths.getDistance()).isEqualTo(3);
    assertThat(paths.getTotal()).isEqualTo(1);
}