@Test
public void testGetDomains() throws Exception {

  WebResource r = resource();
  ClientResponse response = r.path("ws").path("v1").path("timeline")
      .path("domain")
      .queryParam("owner", "owner_1")
      .accept(MediaType.APPLICATION_JSON)
      .get(ClientResponse.class);
  assertEquals(MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
      response.getType().toString());
  TimelineDomains domains = response.getEntity(TimelineDomains.class);
  Assert.assertEquals(2, domains.getDomains().size());
  for (int i = 0; i < domains.getDomains().size(); ++i) {
    verifyDomain(domains.getDomains().get(i),
        i == 0 ? "domain_id_4" : "domain_id_1");
  }
}