Exemplo n.º 1
0
 /** @return true if response does not indicate an error. */
 public boolean responseIsValid() {
   boolean result;
   try {
     response.validResponse();
     result = true;
   } catch (RuntimeException e) {
     result = false;
   }
   return result;
 }
Exemplo n.º 2
0
 protected boolean postToImpl(String body, String serviceUrl) {
   boolean result;
   resetResponse();
   response.setRequest(body);
   String url = getUrl(serviceUrl);
   try {
     getEnvironment().doHttpPost(url, response, headerValues, getContentType());
   } catch (Throwable t) {
     throw new StopTestException("Unable to get response from POST to: " + url, t);
   }
   result = postProcessResponse();
   return result;
 }
Exemplo n.º 3
0
 /** @return http status received in response to last request. */
 public int responseStatus() {
   return response.getStatusCode();
 }
Exemplo n.º 4
0
 /** @return HTML response received last time postTo() or get() was called. */
 public String htmlResponse() {
   String content = response.getResponse();
   content = "<div>" + content + "</div>";
   return content;
 }
Exemplo n.º 5
0
 /** @return response received last time postTo(), delete() or getFrom() was called. */
 public String response() {
   return safeFormatValue(response.getResponse());
 }