com.jayway.restassured.config
Class RedirectConfig

java.lang.Object
  extended by com.jayway.restassured.config.RedirectConfig

public class RedirectConfig
extends Object

Configures the redirect settings that can be used with RestAssured.

See Also:
RestAssuredConfig, org.apache.http.client.params.ClientPNames

Constructor Summary
RedirectConfig()
          Create a new RedirectConfig instance with the following configuration by default: followRedirects = true allowCircularRedirects = false rejectRelativeRedirect = false maxRedirects = 100
RedirectConfig(boolean followRedirects, boolean allowCircularRedirects, boolean rejectRelativeRedirect, int maxRedirects)
          Create a new instance of a RedirectConfig with the supplied settings.
 
Method Summary
 RedirectConfig allowCircularRedirects(boolean value)
          Configure if REST Assured should allow circular redirects
 boolean allowsCircularRedirects()
           
 RedirectConfig and()
          The same RedirectConfig instance.
 RedirectConfig followRedirects(boolean value)
          Configure if REST Assured should follow redirects
 boolean followsRedirects()
           
 int maxRedirects()
           
 RedirectConfig maxRedirects(int value)
          Configure the maximum number of redirects.
static RedirectConfig redirectConfig()
           
 RedirectConfig rejectRelativeRedirect(boolean value)
          Configure if REST Assured should reject relative redirects
 boolean rejectRelativeRedirects()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RedirectConfig

public RedirectConfig()
Create a new RedirectConfig instance with the following configuration by default:
  1. followRedirects = true
  2. allowCircularRedirects = false
  3. rejectRelativeRedirect = false
  4. maxRedirects = 100


RedirectConfig

public RedirectConfig(boolean followRedirects,
                      boolean allowCircularRedirects,
                      boolean rejectRelativeRedirect,
                      int maxRedirects)
Create a new instance of a RedirectConfig with the supplied settings.

Parameters:
followRedirects - Configure if REST Assured should follow redirects
allowCircularRedirects - Configure if REST Assured should allow circular redirects
rejectRelativeRedirect - Configure if REST Assured should reject relative redirects
maxRedirects - Configure the REST Assured maximum number of redirect
Method Detail

followRedirects

public RedirectConfig followRedirects(boolean value)
Configure if REST Assured should follow redirects

Parameters:
value - true if it should follow redirects, false otherwise.
Returns:
An updated RedirectConfig

allowCircularRedirects

public RedirectConfig allowCircularRedirects(boolean value)
Configure if REST Assured should allow circular redirects

Parameters:
value - true if it should allow circular redirects, false otherwise.
Returns:
An updated RedirectConfig

rejectRelativeRedirect

public RedirectConfig rejectRelativeRedirect(boolean value)
Configure if REST Assured should reject relative redirects

Parameters:
value - true if it should reject relative redirects, false otherwise.
Returns:
An updated RedirectConfig

maxRedirects

public RedirectConfig maxRedirects(int value)
Configure the maximum number of redirects.

Parameters:
value - The maximum number of redirects
Returns:
An updated RedirectConfig

and

public RedirectConfig and()
The same RedirectConfig instance. This method is only provided as syntactic sugar.

Returns:

followsRedirects

public boolean followsRedirects()
Returns:
true if configured to follow redirects

allowsCircularRedirects

public boolean allowsCircularRedirects()
Returns:
true if configured to allow circular redirects

rejectRelativeRedirects

public boolean rejectRelativeRedirects()
Returns:
true if configured to reject relative redirects

maxRedirects

public int maxRedirects()
Returns:
The maximum number of redirects.

redirectConfig

public static RedirectConfig redirectConfig()
Returns:
A static way to create a new RedirectConfig instance without calling "new" explicitly. Mainly for syntactic sugar.


Copyright © 2010-2011. All Rights Reserved.