Status implements Comparable<Status> { public Category getCategory() { return Category.valueOf(this); } Status(int code, String name); int getCode(); String getName(); Category getCategory(); boolean isClientError(); boolean isServerError(); boolean isBodyContentAllowed(); int compareTo(Status o); @Override final boolean equals(Object o); @Override final int hashCode(); @Override String toString(); static Status valueOf(int statusCode); static Status[] values(); static Status CONTINUE; static Status SWITCHING_PROTOCOLS; static Status OK; static Status CREATED; static Status ACCEPTED; static Status NON_AUTHORITATIVE_INFORMATION; static Status NO_CONTENT; static Status RESET_CONTENT; static Status PARTIAL_CONTENT; static Status MULTIPLE_CHOICES; static Status MOVED_PERMANENTLY; static Status FOUND; static Status SEE_OTHER; static Status NOT_MODIFIED; static Status USE_PROXY; static Status TEMPORARY_REDIRECT; static Status BAD_REQUEST; static Status UNAUTHORIZED; static Status PAYMENT_REQUIRED; static Status FORBIDDEN; static Status NOT_FOUND; static Status METHOD_NOT_ALLOWED; static Status NOT_ACCEPTABLE; static Status PROXY_AUTHENTICATION_REQUIRED; static Status REQUEST_TIMEOUT; static Status CONFLICT; static Status GONE; static Status LENGTH_REQUIRED; static Status PRECONDITION_FAILED; static Status REQUEST_ENTITY_TOO_LARGE; static Status REQUEST_URI_TOO_LONG; static Status UNSUPPORTED_MEDIA_TYPE; static Status REQUESTED_RANGE_NOT_SATISFIABLE; static Status EXPECTATION_FAILED; static Status INTERNAL_SERVER_ERROR; static Status NOT_IMPLEMENTED; static Status BAD_GATEWAY; static Status SERVICE_UNAVAILABLE; static Status GATEWAY_TIMEOUT; static Status HTTP_VERSION_NOT_SUPPORTED; }
@Test public void checkStatusSuccessCategory() { assertEquals(Status.Category.SUCCESS, Status.OK.getCategory()); assertEquals(Status.Category.SUCCESS, Status.NO_CONTENT.getCategory()); }
@Test public void checkStatusRedirectionCategory() { assertEquals(Status.Category.REDIRECTION, Status.FOUND.getCategory()); }