com.jayway.restassured.config
Class SessionConfig

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

public class SessionConfig
extends Object

Configure session management for REST Assured. Here you can define a default session id value that'll be used for each request as well as defining the default session id name (by default it's ).


Field Summary
static String DEFAULT_SESSION_ID_NAME
           
 
Constructor Summary
SessionConfig()
          Create a new session configuration with session id name "JSESSIONID" and no session id value.
SessionConfig(String sessionIdValue)
          Create a new session configuration with session id name "JSESSIONID" and with the supplied session id value.
SessionConfig(String sessionIdName, String sessionIdValue)
          Create a new session config with the given session id name and value.
 
Method Summary
 SessionConfig and()
          Syntactic sugar.
 boolean isSessionIdValueDefined()
           
static SessionConfig sessionConfig()
           
 String sessionIdName()
           
 SessionConfig sessionIdName(String sessionIdName)
          Set the session id name.
 String sessionIdValue()
           
 SessionConfig sessionIdValue(String defaultSessionId)
          Specify the default session id to use for each request..
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SESSION_ID_NAME

public static final String DEFAULT_SESSION_ID_NAME
See Also:
Constant Field Values
Constructor Detail

SessionConfig

public SessionConfig()
Create a new session configuration with session id name "JSESSIONID" and no session id value.


SessionConfig

public SessionConfig(String sessionIdValue)
Create a new session configuration with session id name "JSESSIONID" and with the supplied session id value.

Parameters:
sessionIdValue - The session id to use for each request.

SessionConfig

public SessionConfig(String sessionIdName,
                     String sessionIdValue)
Create a new session config with the given session id name and value.

Parameters:
sessionIdName - The name of the session id, by default it's "JSESSIONID"
sessionIdValue - The value of the session id. This session id will be used for each request that uses this session configuration instance (unless it's overwritten by the DSL). Default is null.
Method Detail

isSessionIdValueDefined

public boolean isSessionIdValueDefined()

sessionIdValue

public SessionConfig sessionIdValue(String defaultSessionId)
Specify the default session id to use for each request..

Parameters:
defaultSessionId - The stream
Returns:
A new SessionConfig instance

sessionIdName

public SessionConfig sessionIdName(String sessionIdName)
Set the session id name. This is the name of the cookie that contains the session id. By default it's "JSESSIONID".

Parameters:
sessionIdName - The name of the session id variable
Returns:
A new SessionConfig instance

sessionIdName

public String sessionIdName()
Returns:
The session id name

sessionIdValue

public String sessionIdValue()
Returns:
The session id value

sessionConfig

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

and

public SessionConfig and()
Syntactic sugar.

Returns:
The same session config instance.


Copyright © 2010-2012. All Rights Reserved.