@Test
public void testInvalidAttempt() {

  ApplicationId appId = ApplicationId.newInstance(0, 1);
  ApplicationAttemptId appAttemptId =
      ApplicationAttemptId.newInstance(appId, MAX_APPS + 1);
  WebResource r = resource();
  ClientResponse response =
      r.path("ws").path("v1").path("applicationhistory").path("apps")
        .path(appId.toString()).path("appattempts")
        .path(appAttemptId.toString())
        .queryParam("user.name", USERS[round])
        .accept(MediaType.APPLICATION_JSON)
        .get(ClientResponse.class);
  if (round == 1) {
    assertResponseStatusCode(Status.FORBIDDEN, response.getStatusInfo());
    return;
  }
  assertResponseStatusCode("404 not found expected",
      Status.NOT_FOUND, response.getStatusInfo());
}