public class Setters
Abstract class for calling setters using static functions.
| Modifier and Type | Class and Description |
|---|---|
static class |
Setters.Companion |
| Modifier and Type | Field and Description |
|---|---|
static Setters.Companion |
Companion |
| Constructor and Description |
|---|
Setters()
Abstract class for calling setters using static functions.
|
| Modifier and Type | Method and Description |
|---|---|
static Setter |
accept(java.lang.String mediaType)
Get accept setter.
|
static Setter |
accept(ContentType contentType)
Getting accept setter.
|
static Setter |
baseUri(java.lang.String baseUri)
Getting baseUri setter.
|
static Setter |
basicAuth(java.lang.String userName,
java.lang.String password)
Use http basic authentication.
|
static Setter |
body(java.lang.String body)
Get requestSpecification body setter.
|
static Setter |
body(java.io.Serializable body)
Get requestSpecification body setter.
|
static Setter |
contentType(ContentType type)
Get content type setter.
|
static Setter |
contentType(java.lang.String type)
Get content type setter.
|
static Setter |
cookie(java.lang.String name,
java.lang.String value,
java.lang.String additionalValues)
Get cookie setter.
|
static Setter |
cookie(java.lang.String name,
java.lang.String value)
Get cookie setter.
|
static Setter |
cookie(java.lang.String name)
Get cookie setter.
|
static Setter |
defaultParser(Parser parser)
Register a default predefined parser that will be used if no other parser (registered or pre-defined) matches the response content-type.
|
static Setter |
formParam(java.lang.String key,
java.lang.Object value)
Get form param setter.
|
static Setter |
header(java.lang.String name,
java.lang.String value)
Get header setter.
|
static Setter |
host(java.lang.String host)
Get requestSpecification host setter.
|
static Setter |
jsonParam(java.lang.String key,
java.lang.Object value)
Get json param setter.
|
static Setter |
multiPart(java.lang.String controlName,
java.lang.String fileName,
java.io.InputStream stream)
Get multi part setter.
|
static Setter |
multiPart(java.lang.String controlName,
java.lang.String fileName,
java.io.InputStream stream,
java.lang.String mimeType)
Get multi part setter.
|
static Setter |
multiPart(java.io.File file)
Get multi part setter.
|
static Setter |
multiPart(java.lang.String controlName,
java.io.File file)
Get multi part setter.
|
static Setter |
multiPart(io.restassured.specification.MultiPartSpecification multiPartSpecification)
Get multi part setter.
|
static Setter |
noAuth()
Clear all authentication settings.
|
static Setter |
oauth1(java.lang.String consumerKey,
java.lang.String consumerSecret,
java.lang.String token,
java.lang.String tokenSecret)
Set all OAuth 1.0 authentication settings.
|
static Setter |
oauth2(java.lang.String token)
Set all OAuth 2.0 authentication settings.
|
static Setter |
param(java.lang.String key,
java.lang.Object value)
Get param setter.
|
static Setter |
parser(java.lang.String contentType,
Parser parser)
Register a content-type to be parsed using a predefined parser.
|
static Setter |
path(java.lang.String path)
Get requestSpecification path setter.
|
static Setter |
pathParam(java.lang.String key,
java.lang.Object value)
Get path param setter.
|
static Setter |
port(int port)
Get requestSpecification port setter.
|
static Setter |
protocol(java.lang.String protocol)
Get requestSpecification protocol setter.
|
static Setter |
queryParam(java.lang.String key,
java.lang.Object value)
Get query param setter.
|
static Setter |
redirects(int max)
Get redirect setter.
|
static Setter |
redirects(boolean follow)
Get redirect setter.
|
static Setter |
urlEncodingEnabled(boolean isEnabled)
Specifies if RestTest should url encode the URL automatically. Usually, this is recommended but in some cases
(e.g. the query parameters are already be encoded before you provide them to RestTest) then it's useful to disable
URL encoding.
|
public static Setters.Companion Companion
public Setters()
Abstract class for calling setters using static functions.
public static Setter baseUri(java.lang.String baseUri)
Getting baseUri setter.
baseUri - of request.public static Setter contentType(ContentType type)
Get content type setter.
type - Content type of the request.public static Setter contentType(java.lang.String type)
Get content type setter.
type - Content type of the request.public static Setter param(java.lang.String key, java.lang.Object value)
Get param setter.
key - Key of param.value - Value of param.public static Setter queryParam(java.lang.String key, java.lang.Object value)
Get query param setter.
key - Key of query param.value - Value of query param.public static Setter formParam(java.lang.String key, java.lang.Object value)
Get form param setter.
key - Key of form param.value - Value of form param.public static Setter jsonParam(java.lang.String key, java.lang.Object value)
Get json param setter.
key - Key of json param.value - Value of json param.public static Setter cookie(java.lang.String name, java.lang.String value, java.lang.String additionalValues)
Get cookie setter.
name - Name of cookie.value - Value of cookie.additionalValues - Additional values of cookie.public static Setter cookie(java.lang.String name, java.lang.String value)
Get cookie setter.
name - Name of cookie.value - Value of cookie.public static Setter cookie(java.lang.String name)
Get cookie setter.
name - Name of cookie.public static Setter header(java.lang.String name, java.lang.String value)
Get header setter.
name - Name of header.value - Value of header.public static Setter body(java.lang.String body)
Get requestSpecification body setter.
body - Body of requestSpecification.public static Setter body(java.io.Serializable body)
Get requestSpecification body setter.
body - Body of requestSpecification.public static Setter protocol(java.lang.String protocol)
Get requestSpecification protocol setter.
protocol - Protocol of requestSpecification.public static Setter host(java.lang.String host)
Get requestSpecification host setter.
host - Host of requestSpecification.public static Setter path(java.lang.String path)
Get requestSpecification path setter.
path - Path of requestSpecification.public static Setter port(int port)
Get requestSpecification port setter.
port - Port of requestSpecification.public static Setter pathParam(java.lang.String key, java.lang.Object value)
Get path param setter.
key - Key of path param.value - Value of path param.public static Setter multiPart(java.lang.String controlName, java.lang.String fileName, java.io.InputStream stream)
Get multi part setter.
controlName - Control name of the body part. In HTML this is the attribute name of the input tag.fileName - File name of the content you're uploading.stream - Stream you want to requestSpecification.public static Setter multiPart(java.lang.String controlName, java.lang.String fileName, java.io.InputStream stream, java.lang.String mimeType)
Get multi part setter.
controlName - Control name of the body part. In HTML this is the attribute name of the input tag.fileName - File name of the content you're uploading.stream - Stream you want to requestSpecification.mimeType - The mime-type.public static Setter multiPart(java.io.File file)
Get multi part setter.
file - File to upload.public static Setter multiPart(java.lang.String controlName, java.io.File file)
Get multi part setter.
file - File to upload.controlName - Defines the control name of the body part. In HTML this is the attribute name of the input tag.public static Setter multiPart(io.restassured.specification.MultiPartSpecification multiPartSpecification)
Get multi part setter.
multiPartSpecification - Multi part specification of your request.public static Setter redirects(int max)
Get redirect setter.
max - Maximum count of redirects.public static Setter redirects(boolean follow)
Get redirect setter.
follow - Follow redirects.public static Setter accept(java.lang.String mediaType)
Get accept setter.
mediaType - Media type of request.public static Setter accept(ContentType contentType)
Getting accept setter.
contentType - Content type of request.public static Setter urlEncodingEnabled(boolean isEnabled)
Specifies if RestTest should url encode the URL automatically. Usually, this is recommended but in some cases (e.g. the query parameters are already be encoded before you provide them to RestTest) then it's useful to disable URL encoding.
isEnabled - Is URL encoding enabled or disabled.public static Setter basicAuth(java.lang.String userName, java.lang.String password)
Use http basic authentication.
userName - User name of your account.password - Password of your account.public static Setter oauth1(java.lang.String consumerKey, java.lang.String consumerSecret, java.lang.String token, java.lang.String tokenSecret)
Set all OAuth 1.0 authentication settings.
public static Setter oauth2(java.lang.String token)
Set all OAuth 2.0 authentication settings.
public static Setter noAuth()
Clear all authentication settings.
public static Setter parser(java.lang.String contentType, Parser parser)
Register a content-type to be parsed using a predefined parser.