@Override /* RestCallInterceptor */ public void onInit(RestCall restCall) { if (log.isLoggable(level)) restCall.captureResponse(); }
@Override /* RestCallInterceptor */ public void onInit(RestCall restCall) { if (log.isLoggable(level)) restCall.captureResponse(); }
@Override /* RestCallInterceptor */ public void onInit(RestCall restCall) { if (log.isLoggable(level)) restCall.captureResponse(); }
/** * Adds a response pattern finder to look for regular expression matches in the response output. * * <p> * This method can be called multiple times to add multiple response pattern finders. * * <p> * {@link ResponsePattern ResponsePatterns} use the {@link #getCapturedResponse()} to read the response text and so * does not affect the other output methods such as {@link #getResponseAsString()}. * * @param responsePattern The response pattern finder. * @return This object (for method chaining). */ public RestCall responsePattern(final ResponsePattern responsePattern) { captureResponse(); interceptor( new RestCallInterceptor() { @Override public void onClose(RestCall restCall) throws RestCallException { responsePattern.match(RestCall.this); } } ); return this; }
/** * Adds a response pattern finder to look for regular expression matches in the response output. * * <p> * This method can be called multiple times to add multiple response pattern finders. * * <p> * {@link ResponsePattern ResponsePatterns} use the {@link #getCapturedResponse()} to read the response text and so * does not affect the other output methods such as {@link #getResponseAsString()}. * * @param responsePattern The response pattern finder. * @return This object (for method chaining). */ public RestCall responsePattern(final ResponsePattern responsePattern) { captureResponse(); interceptor( new RestCallInterceptor() { @Override public void onClose(RestCall restCall) throws RestCallException { responsePattern.match(RestCall.this); } } ); return this; }
/** * Adds a response pattern finder to look for regular expression matches in the response output. * * <p> * This method can be called multiple times to add multiple response pattern finders. * * <p> * {@link ResponsePattern ResponsePatterns} use the {@link #getCapturedResponse()} to read the response text and so * does not affect the other output methods such as {@link #getResponseAsString()}. * * @param responsePattern The response pattern finder. * @return This object (for method chaining). */ public RestCall responsePattern(final ResponsePattern responsePattern) { captureResponse(); interceptor( new RestCallInterceptor() { @Override public void onClose(RestCall restCall) throws RestCallException { responsePattern.match(RestCall.this); } } ); return this; }