Package net.serenitybdd.rest
Class SerenityRest
java.lang.Object
net.serenitybdd.rest.SerenityRest
public class SerenityRest
extends java.lang.Object
User: YamStranger
Date: 3/14/16
Time: 8:51 AM
-
Constructor Summary
Constructors Constructor Description SerenityRest() -
Method Summary
Modifier and Type Method Description static io.restassured.response.ValidatableResponseand()static io.restassured.specification.RequestSenderandGiven()Add an additional clause to a RestAssured querystatic io.restassured.authentication.AuthenticationSchemebasic(java.lang.String userName, java.lang.String password)static io.restassured.authentication.AuthenticationSchemecertificate(java.lang.String certURL, java.lang.String password)static io.restassured.authentication.AuthenticationSchemecertificate(java.lang.String certURL, java.lang.String password, io.restassured.authentication.CertificateAuthSettings certificateAuthSettings)static voidclear()Clear the current RestAssured test context, so that the next when() call will create a new RestAssured querystatic io.restassured.config.RestAssuredConfigconfig()static io.restassured.response.Responsedelete()static io.restassured.response.Responsedelete(java.lang.String path, java.lang.Object... pathParams)static io.restassured.response.Responsedelete(java.lang.String path, java.util.Map<java.lang.String,?> pathParams)static io.restassured.response.Responsedelete(java.net.URI uri)static io.restassured.response.Responsedelete(java.net.URL url)static io.restassured.authentication.AuthenticationSchemedigest(java.lang.String userName, java.lang.String password)static io.restassured.config.LogConfigenableLoggingOfRequestAndResponseIfValidationFails()static io.restassured.config.LogConfigenableLoggingOfRequestAndResponseIfValidationFails(io.restassured.filter.log.LogDetail logDetail)static io.restassured.specification.ResponseSpecificationexpect()static java.util.List<io.restassured.filter.Filter>filters()static java.util.List<io.restassured.filter.Filter>filters(io.restassured.filter.Filter filter, io.restassured.filter.Filter... additionalFilters)static java.util.List<io.restassured.filter.Filter>filters(java.util.List<io.restassured.filter.Filter> filters)static io.restassured.authentication.AuthenticationSchemeform(java.lang.String userName, java.lang.String password)static io.restassured.authentication.AuthenticationSchemeform(java.lang.String userName, java.lang.String password, io.restassured.authentication.FormAuthConfig config)static io.restassured.response.Responseget()static io.restassured.response.Responseget(java.lang.String path, java.lang.Object... pathParams)static io.restassured.response.Responseget(java.lang.String path, java.util.Map<java.lang.String,?> pathParams)static io.restassured.response.Responseget(java.net.URI uri)static io.restassured.response.Responseget(java.net.URL url)static io.restassured.authentication.AuthenticationSchemegetDefaultAuthentication()static java.lang.StringgetDefaultBasePath()static io.restassured.config.RestAssuredConfiggetDefaultConfig()static io.restassured.parsing.ParsergetDefaultParser()static intgetDefaultPort()static io.restassured.specification.ProxySpecificationgetDefaultProxy()static io.restassured.specification.RequestSpecificationgetDefaultRequestSpecification()static io.restassured.specification.ResponseSpecificationgetDefaultResponseSpecification()static java.lang.StringgetDefaultRootPath()static java.lang.StringgetDefaultSessionId()static io.restassured.specification.RequestSpecificationgiven()Create a new RestAssured query sequencestatic io.restassured.specification.RequestSpecificationgiven(io.restassured.specification.RequestSpecification requestSpecification)static io.restassured.specification.RequestSendergiven(io.restassured.specification.RequestSpecification request, io.restassured.specification.ResponseSpecification response)static io.restassured.specification.RequestSpecificationgivenWithNoReporting()static io.restassured.response.Responsehead()static io.restassured.response.Responsehead(java.lang.String path, java.lang.Object... pathParams)static io.restassured.response.Responsehead(java.lang.String path, java.util.Map<java.lang.String,?> pathParams)static io.restassured.response.Responsehead(java.net.URI uri)static io.restassured.response.Responsehead(java.net.URL url)static booleanisUrlEncodingEnabled()static io.restassured.config.SSLConfigkeystore(java.io.File pathToJks, java.lang.String password)static io.restassured.config.SSLConfigkeystore(java.lang.String password)static io.restassured.config.SSLConfigkeystore(java.lang.String pathToJks, java.lang.String password)static io.restassured.response.ResponselastResponse()static io.restassured.authentication.AuthenticationSchemeoauth(java.lang.String consumerKey, java.lang.String consumerSecret, java.lang.String accessToken, java.lang.String secretToken)static io.restassured.authentication.AuthenticationSchemeoauth(java.lang.String consumerKey, java.lang.String consumerSecret, java.lang.String accessToken, java.lang.String secretToken, io.restassured.authentication.OAuthSignature signature)static io.restassured.authentication.AuthenticationSchemeoauth2(java.lang.String accessToken)static io.restassured.authentication.AuthenticationSchemeoauth2(java.lang.String accessToken, io.restassured.authentication.OAuthSignature signature)static io.restassured.mapper.ObjectMapperobjectMapper(io.restassured.mapper.ObjectMapper objectMapper)static io.restassured.response.Responseoptions()static io.restassured.response.Responseoptions(java.lang.String path, java.lang.Object... pathParams)static io.restassured.response.Responseoptions(java.lang.String path, java.util.Map<java.lang.String,?> pathParams)static io.restassured.response.Responseoptions(java.net.URI uri)static io.restassured.response.Responseoptions(java.net.URL url)static io.restassured.response.Responsepatch()static io.restassured.response.Responsepatch(java.lang.String path, java.lang.Object... pathParams)static io.restassured.response.Responsepatch(java.lang.String path, java.util.Map<java.lang.String,?> pathParams)static io.restassured.response.Responsepatch(java.net.URI uri)static io.restassured.response.Responsepatch(java.net.URL url)static io.restassured.response.Responsepost()static io.restassured.response.Responsepost(java.lang.String path, java.lang.Object... pathParams)static io.restassured.response.Responsepost(java.lang.String path, java.util.Map<java.lang.String,?> pathParams)static io.restassured.response.Responsepost(java.net.URI uri)static io.restassured.response.Responsepost(java.net.URL url)static io.restassured.authentication.PreemptiveAuthProviderpreemptive()static io.restassured.specification.ProxySpecificationproxy(int port)static io.restassured.specification.ProxySpecificationproxy(io.restassured.specification.ProxySpecification proxySpecification)static io.restassured.specification.ProxySpecificationproxy(java.lang.String host)static io.restassured.specification.ProxySpecificationproxy(java.lang.String host, int port)static io.restassured.specification.ProxySpecificationproxy(java.lang.String host, int port, java.lang.String scheme)static io.restassured.specification.ProxySpecificationproxy(java.net.URI uri)static io.restassured.response.Responseput()static io.restassured.response.Responseput(java.lang.String path, java.lang.Object... pathParams)static io.restassured.response.Responseput(java.net.URI uri)static io.restassured.response.Responseput(java.net.URL url)static voidregisterParser(java.lang.String contentType, io.restassured.parsing.Parser parser)static java.util.List<io.restassured.filter.Filter>replaceFiltersWith(io.restassured.filter.Filter filter, io.restassured.filter.Filter... additionalFilters)static java.util.List<io.restassured.filter.Filter>replaceFiltersWith(java.util.List<io.restassured.filter.Filter> filters)static voidreset()static io.restassured.specification.RequestSpecificationrest()static voidrestAssuredThat(java.util.function.Consumer<io.restassured.response.ValidatableResponse> expectedCondition)A convenience method that allows you to check the last response received using a lambda expression, e.g.static io.restassured.authentication.AuthenticationSchemesetDefaultAuthentication(io.restassured.authentication.AuthenticationScheme authentication)static java.lang.StringsetDefaultBasePath(java.lang.String basePath)static io.restassured.config.RestAssuredConfigsetDefaultConfig(io.restassured.config.RestAssuredConfig config)static io.restassured.parsing.ParsersetDefaultParser(io.restassured.parsing.Parser defaultParser)static intsetDefaultPort(int port)static io.restassured.specification.ProxySpecificationsetDefaultProxy(int port)static io.restassured.specification.ProxySpecificationsetDefaultProxy(io.restassured.specification.ProxySpecification proxy)static io.restassured.specification.ProxySpecificationsetDefaultProxy(java.lang.String host, int port)static io.restassured.specification.ProxySpecificationsetDefaultProxy(java.lang.String host, int port, java.lang.String scheme)static io.restassured.specification.ProxySpecificationsetDefaultProxy(java.net.URI uri)static io.restassured.specification.RequestSpecificationsetDefaultRequestSpecification(io.restassured.specification.RequestSpecification requestSpecification)static io.restassured.specification.ResponseSpecificationsetDefaultResponseSpecification(io.restassured.specification.ResponseSpecification responseSpecification)static java.lang.StringsetDefaultRootPath(java.lang.String rootPath)static java.lang.StringsetDefaultSessionId(java.lang.String sessionId)static booleansetUrlEncodingEnabled(boolean urlEncodingEnabled)static io.restassured.response.ValidatableResponsethen()static io.restassured.config.SSLConfigtrustStore(java.security.KeyStore truststore)static voidunregisterParser(java.lang.String contentType)static io.restassured.config.SSLConfiguseRelaxedHTTPSValidation()static io.restassured.config.SSLConfiguseRelaxedHTTPSValidation(java.lang.String protocol)static io.restassured.specification.RequestSenderwhen()Add an action to a RestAssured query, building on previous given() statements if they were called.static io.restassured.specification.RequestSpecificationwith()static java.util.List<io.restassured.specification.Argument>withArgs(java.lang.Object firstArgument, java.lang.Object... additionalArguments)static java.util.List<io.restassured.specification.Argument>withArguments(java.lang.Object firstArgument, java.lang.Object... additionalArguments)static java.util.List<io.restassured.specification.Argument>withNoArgs()static java.util.List<io.restassured.specification.Argument>withNoArguments()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
SerenityRest
public SerenityRest()
-
-
Method Details
-
rest
public static io.restassured.specification.RequestSpecification rest() -
and
public static io.restassured.response.ValidatableResponse and() -
then
public static io.restassured.response.ValidatableResponse then() -
lastResponse
public static io.restassured.response.Response lastResponse() -
setDefaultBasePath
public static java.lang.String setDefaultBasePath(java.lang.String basePath) -
getDefaultBasePath
public static java.lang.String getDefaultBasePath() -
getDefaultPort
public static int getDefaultPort() -
setDefaultPort
public static int setDefaultPort(int port) -
isUrlEncodingEnabled
public static boolean isUrlEncodingEnabled() -
setUrlEncodingEnabled
public static boolean setUrlEncodingEnabled(boolean urlEncodingEnabled) -
getDefaultRootPath
public static java.lang.String getDefaultRootPath() -
setDefaultRootPath
public static java.lang.String setDefaultRootPath(java.lang.String rootPath) -
getDefaultSessionId
public static java.lang.String getDefaultSessionId() -
setDefaultSessionId
public static java.lang.String setDefaultSessionId(java.lang.String sessionId) -
getDefaultAuthentication
public static io.restassured.authentication.AuthenticationScheme getDefaultAuthentication() -
setDefaultAuthentication
public static io.restassured.authentication.AuthenticationScheme setDefaultAuthentication(io.restassured.authentication.AuthenticationScheme authentication) -
getDefaultRequestSpecification
public static io.restassured.specification.RequestSpecification getDefaultRequestSpecification() -
setDefaultRequestSpecification
public static io.restassured.specification.RequestSpecification setDefaultRequestSpecification(io.restassured.specification.RequestSpecification requestSpecification) -
getDefaultParser
public static io.restassured.parsing.Parser getDefaultParser() -
setDefaultParser
public static io.restassured.parsing.Parser setDefaultParser(io.restassured.parsing.Parser defaultParser) -
getDefaultResponseSpecification
public static io.restassured.specification.ResponseSpecification getDefaultResponseSpecification() -
setDefaultResponseSpecification
public static io.restassured.specification.ResponseSpecification setDefaultResponseSpecification(io.restassured.specification.ResponseSpecification responseSpecification) -
reset
public static void reset() -
filters
public static java.util.List<io.restassured.filter.Filter> filters(java.util.List<io.restassured.filter.Filter> filters) -
filters
public static java.util.List<io.restassured.filter.Filter> filters(io.restassured.filter.Filter filter, io.restassured.filter.Filter... additionalFilters) -
replaceFiltersWith
public static java.util.List<io.restassured.filter.Filter> replaceFiltersWith(java.util.List<io.restassured.filter.Filter> filters) -
replaceFiltersWith
public static java.util.List<io.restassured.filter.Filter> replaceFiltersWith(io.restassured.filter.Filter filter, io.restassured.filter.Filter... additionalFilters) -
filters
public static java.util.List<io.restassured.filter.Filter> filters() -
objectMapper
public static io.restassured.mapper.ObjectMapper objectMapper(io.restassured.mapper.ObjectMapper objectMapper) -
expect
public static io.restassured.specification.ResponseSpecification expect() -
with
public static io.restassured.specification.RequestSpecification with() -
withArguments
public static java.util.List<io.restassured.specification.Argument> withArguments(java.lang.Object firstArgument, java.lang.Object... additionalArguments) -
withNoArguments
public static java.util.List<io.restassured.specification.Argument> withNoArguments() -
withArgs
public static java.util.List<io.restassured.specification.Argument> withArgs(java.lang.Object firstArgument, java.lang.Object... additionalArguments) -
withNoArgs
public static java.util.List<io.restassured.specification.Argument> withNoArgs() -
given
public static io.restassured.specification.RequestSpecification given()Create a new RestAssured query sequence- Returns:
-
givenWithNoReporting
public static io.restassured.specification.RequestSpecification givenWithNoReporting() -
andGiven
public static io.restassured.specification.RequestSender andGiven()Add an additional clause to a RestAssured query- Returns:
-
clear
public static void clear()Clear the current RestAssured test context, so that the next when() call will create a new RestAssured query -
when
public static io.restassured.specification.RequestSender when()Add an action to a RestAssured query, building on previous given() statements if they were called.- Returns:
-
given
public static io.restassured.specification.RequestSender given(io.restassured.specification.RequestSpecification request, io.restassured.specification.ResponseSpecification response) -
given
public static io.restassured.specification.RequestSpecification given(io.restassured.specification.RequestSpecification requestSpecification) -
useRelaxedHTTPSValidation
public static io.restassured.config.SSLConfig useRelaxedHTTPSValidation() -
useRelaxedHTTPSValidation
public static io.restassured.config.SSLConfig useRelaxedHTTPSValidation(java.lang.String protocol) -
registerParser
public static void registerParser(java.lang.String contentType, io.restassured.parsing.Parser parser) -
unregisterParser
public static void unregisterParser(java.lang.String contentType) -
oauth2
public static io.restassured.authentication.AuthenticationScheme oauth2(java.lang.String accessToken) -
trustStore
public static io.restassured.config.SSLConfig trustStore(java.security.KeyStore truststore) -
certificate
public static io.restassured.authentication.AuthenticationScheme certificate(java.lang.String certURL, java.lang.String password) -
enableLoggingOfRequestAndResponseIfValidationFails
public static io.restassured.config.LogConfig enableLoggingOfRequestAndResponseIfValidationFails() -
enableLoggingOfRequestAndResponseIfValidationFails
public static io.restassured.config.LogConfig enableLoggingOfRequestAndResponseIfValidationFails(io.restassured.filter.log.LogDetail logDetail) -
certificate
public static io.restassured.authentication.AuthenticationScheme certificate(java.lang.String certURL, java.lang.String password, io.restassured.authentication.CertificateAuthSettings certificateAuthSettings) -
form
public static io.restassured.authentication.AuthenticationScheme form(java.lang.String userName, java.lang.String password) -
preemptive
public static io.restassured.authentication.PreemptiveAuthProvider preemptive() -
form
public static io.restassured.authentication.AuthenticationScheme form(java.lang.String userName, java.lang.String password, io.restassured.authentication.FormAuthConfig config) -
oauth2
public static io.restassured.authentication.AuthenticationScheme oauth2(java.lang.String accessToken, io.restassured.authentication.OAuthSignature signature) -
basic
public static io.restassured.authentication.AuthenticationScheme basic(java.lang.String userName, java.lang.String password) -
proxy
public static io.restassured.specification.ProxySpecification proxy(java.lang.String host, int port, java.lang.String scheme) -
proxy
public static io.restassured.specification.ProxySpecification proxy(java.lang.String host, int port) -
proxy
public static io.restassured.specification.ProxySpecification proxy(int port) -
proxy
public static io.restassured.specification.ProxySpecification proxy(java.net.URI uri) -
proxy
public static io.restassured.specification.ProxySpecification proxy(java.lang.String host) -
proxy
public static io.restassured.specification.ProxySpecification proxy(io.restassured.specification.ProxySpecification proxySpecification) -
setDefaultProxy
public static io.restassured.specification.ProxySpecification setDefaultProxy(java.lang.String host, int port, java.lang.String scheme) -
setDefaultProxy
public static io.restassured.specification.ProxySpecification setDefaultProxy(io.restassured.specification.ProxySpecification proxy) -
setDefaultProxy
public static io.restassured.specification.ProxySpecification setDefaultProxy(java.lang.String host, int port) -
setDefaultProxy
public static io.restassured.specification.ProxySpecification setDefaultProxy(int port) -
setDefaultProxy
public static io.restassured.specification.ProxySpecification setDefaultProxy(java.net.URI uri) -
getDefaultProxy
public static io.restassured.specification.ProxySpecification getDefaultProxy() -
keystore
public static io.restassured.config.SSLConfig keystore(java.io.File pathToJks, java.lang.String password) -
keystore
public static io.restassured.config.SSLConfig keystore(java.lang.String password) -
keystore
public static io.restassured.config.SSLConfig keystore(java.lang.String pathToJks, java.lang.String password) -
head
public static io.restassured.response.Response head(java.net.URI uri) -
head
public static io.restassured.response.Response head() -
head
public static io.restassured.response.Response head(java.lang.String path, java.lang.Object... pathParams) -
head
public static io.restassured.response.Response head(java.lang.String path, java.util.Map<java.lang.String,?> pathParams) -
head
public static io.restassured.response.Response head(java.net.URL url) -
config
public static io.restassured.config.RestAssuredConfig config() -
getDefaultConfig
public static io.restassured.config.RestAssuredConfig getDefaultConfig() -
setDefaultConfig
public static io.restassured.config.RestAssuredConfig setDefaultConfig(io.restassured.config.RestAssuredConfig config) -
oauth
public static io.restassured.authentication.AuthenticationScheme oauth(java.lang.String consumerKey, java.lang.String consumerSecret, java.lang.String accessToken, java.lang.String secretToken, io.restassured.authentication.OAuthSignature signature) -
oauth
public static io.restassured.authentication.AuthenticationScheme oauth(java.lang.String consumerKey, java.lang.String consumerSecret, java.lang.String accessToken, java.lang.String secretToken) -
digest
public static io.restassured.authentication.AuthenticationScheme digest(java.lang.String userName, java.lang.String password) -
options
public static io.restassured.response.Response options() -
options
public static io.restassured.response.Response options(java.net.URL url) -
options
public static io.restassured.response.Response options(java.net.URI uri) -
options
public static io.restassured.response.Response options(java.lang.String path, java.lang.Object... pathParams) -
options
public static io.restassured.response.Response options(java.lang.String path, java.util.Map<java.lang.String,?> pathParams) -
patch
public static io.restassured.response.Response patch(java.lang.String path, java.util.Map<java.lang.String,?> pathParams) -
patch
public static io.restassured.response.Response patch(java.net.URI uri) -
patch
public static io.restassured.response.Response patch(java.net.URL url) -
patch
public static io.restassured.response.Response patch() -
patch
public static io.restassured.response.Response patch(java.lang.String path, java.lang.Object... pathParams) -
post
public static io.restassured.response.Response post(java.lang.String path, java.lang.Object... pathParams) -
post
public static io.restassured.response.Response post(java.lang.String path, java.util.Map<java.lang.String,?> pathParams) -
post
public static io.restassured.response.Response post(java.net.URL url) -
post
public static io.restassured.response.Response post() -
post
public static io.restassured.response.Response post(java.net.URI uri) -
put
public static io.restassured.response.Response put(java.net.URI uri) -
put
public static io.restassured.response.Response put(java.lang.String path, java.lang.Object... pathParams) -
put
public static io.restassured.response.Response put() -
put
public static io.restassured.response.Response put(java.net.URL url) -
delete
public static io.restassured.response.Response delete(java.lang.String path, java.util.Map<java.lang.String,?> pathParams) -
delete
public static io.restassured.response.Response delete(java.net.URL url) -
delete
public static io.restassured.response.Response delete(java.net.URI uri) -
delete
public static io.restassured.response.Response delete() -
delete
public static io.restassured.response.Response delete(java.lang.String path, java.lang.Object... pathParams) -
get
public static io.restassured.response.Response get(java.net.URI uri) -
get
public static io.restassured.response.Response get(java.net.URL url) -
get
public static io.restassured.response.Response get(java.lang.String path, java.lang.Object... pathParams) -
get
public static io.restassured.response.Response get(java.lang.String path, java.util.Map<java.lang.String,?> pathParams) -
get
public static io.restassured.response.Response get() -
restAssuredThat
public static void restAssuredThat(java.util.function.Consumer<io.restassured.response.ValidatableResponse> expectedCondition)A convenience method that allows you to check the last response received using a lambda expression, e.g. restAssuredThat(lastResponse -> lastResponse.body(equalTo(expectedMessage)));
-