@Test
public void testGetDomainYarnACLsEnabled() {

  AdminACLsManager oldAdminACLsManager =
      timelineACLsManager.setAdminACLsManager(adminACLsManager);
  try {
    WebResource r = resource();
    ClientResponse response = r.path("ws").path("v1").path("timeline")
        .path("domain").path("domain_id_1")
        .queryParam("user.name", "owner_1")
        .accept(MediaType.APPLICATION_JSON)
        .get(ClientResponse.class);
    assertEquals(MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
        response.getType().toString());
    TimelineDomain domain = response.getEntity(TimelineDomain.class);
    verifyDomain(domain, "domain_id_1");
    response = r.path("ws").path("v1").path("timeline")
        .path("domain").path("domain_id_1")
        .queryParam("user.name", "tester")
        .accept(MediaType.APPLICATION_JSON)
        .get(ClientResponse.class);
    assertEquals(MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
        response.getType().toString());
    assertResponseStatusCode(Status.NOT_FOUND, response.getStatusInfo());
  } finally {
    timelineACLsManager.setAdminACLsManager(oldAdminACLsManager);
  }
}