LiferayResponseValidator { public void validate(HttpResponse httpResponse) throws ModuleException { if (httpResponse == null) { throw new ModuleException( "Server returned no response", LiferayError.SERVER_ERROR); } else if (httpResponse.getStatusCode() >= 400) { throw new ModuleException( getMessage(httpResponse), LiferayError.fromStatus(httpResponse.getStatusCode())); } }  void validate(HttpResponse httpResponse);  }
@Test public void testValidateResponseStatus200() throws Exception { HttpConstants.HttpStatus httpStatus = HttpConstants.HttpStatus.OK; liferayResponseValidator.validate( getHttpResponse( httpStatus.getReasonPhrase(), httpStatus.getStatusCode())); }