Class RestAssuredMockMvcConfig
java.lang.Object
io.restassured.module.mockmvc.config.RestAssuredMockMvcConfig
- All Implemented Interfaces:
SpecificationConfig
Main configuration for REST Assured Mock MVC that allows you to configure advanced settings.
Usage example:
RestAssuredMockMvc.config = new RestAssuredMockMvcConfig().logConfig(new LogConfig(captor, true));
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new RestAssuredMockMvcConfig with the default configurations. -
Method Summary
Modifier and TypeMethodDescriptionand()Syntactic sugar.asyncConfig(AsyncConfig asyncConfig) Set the async configclientConfig(ClientConfig clientConfig) static RestAssuredMockMvcConfigconfig()decoderConfig(io.restassured.config.DecoderConfig decoderConfig) Set the decoder configencoderConfig(io.restassured.config.EncoderConfig encoderConfig) Set the encoder configio.restassured.config.DecoderConfigio.restassured.config.EncoderConfigio.restassured.config.HeaderConfigio.restassured.config.JsonConfigio.restassured.config.LogConfigio.restassured.config.MatcherConfigio.restassured.config.MultiPartConfigio.restassured.config.ObjectMapperConfigio.restassured.config.ParamConfigio.restassured.config.SessionConfigio.restassured.config.XmlConfigheaderConfig(io.restassured.config.HeaderConfig headerConfig) Set the header configbooleanjsonConfig(io.restassured.config.JsonConfig jsonConfig) Set the Json config.logConfig(io.restassured.config.LogConfig logConfig) Set the Log config.matcherConfig(io.restassured.config.MatcherConfig matcherConfig) Set the matcher configmockMvcConfig(MockMvcConfig mockMvcConfig) Set the MockMVC configmultiPartConfig(io.restassured.config.MultiPartConfig multiPartConfig) Set the multi-part configstatic RestAssuredMockMvcConfigobjectMapperConfig(io.restassured.config.ObjectMapperConfig objectMapperConfig) Set the object mapper config.paramConfig(io.restassured.config.ParamConfig paramConfig) paramConfig(MockMvcParamConfig paramConfig) Set the parameter configsessionConfig(io.restassured.config.SessionConfig sessionConfig) Set the session config.set()Syntactic sugar.with()Syntactic sugar.xmlConfig(io.restassured.config.XmlConfig xmlConfig) Set the Xml config.
-
Constructor Details
-
RestAssuredMockMvcConfig
public RestAssuredMockMvcConfig()Create a new RestAssuredMockMvcConfig with the default configurations.
-
-
Method Details
-
logConfig
Set the Log config.- Specified by:
logConfigin interfaceSpecificationConfig- Parameters:
logConfig- TheLogConfigto set- Returns:
- An updated RestAssuredMockMvcConfig
-
sessionConfig
Set the session config.- Specified by:
sessionConfigin interfaceSpecificationConfig- Parameters:
sessionConfig- TheSessionConfigto set- Returns:
- An updated RestAssuredMockMvcConfig
-
objectMapperConfig
public RestAssuredMockMvcConfig objectMapperConfig(io.restassured.config.ObjectMapperConfig objectMapperConfig) Set the object mapper config.- Specified by:
objectMapperConfigin interfaceSpecificationConfig- Parameters:
objectMapperConfig- TheObjectMapperConfigto set- Returns:
- An updated RestAssuredMockMvcConfig
-
jsonConfig
Set the Json config.- Specified by:
jsonConfigin interfaceSpecificationConfig- Parameters:
jsonConfig- TheJsonConfigto set- Returns:
- An updated RestAssuredMockMvcConfig
-
xmlConfig
Set the Xml config.- Specified by:
xmlConfigin interfaceSpecificationConfig- Parameters:
xmlConfig- TheXmlConfigto set- Returns:
- An updated RestAssuredMockMvcConfig
-
encoderConfig
Set the encoder config- Specified by:
encoderConfigin interfaceSpecificationConfig- Parameters:
encoderConfig- TheEncoderConfigto set- Returns:
- An updated RestAssuredMockMvcConfig
-
decoderConfig
Set the decoder config- Specified by:
decoderConfigin interfaceSpecificationConfig- Parameters:
decoderConfig- TheDecoderConfigto set- Returns:
- An updated RestAssuredMockMvcConfig
-
headerConfig
Set the header config- Specified by:
headerConfigin interfaceSpecificationConfig- Parameters:
headerConfig- TheHeaderConfigto set- Returns:
- An updated RestAssuredMockMvcConfig
-
asyncConfig
Set the async config- Specified by:
asyncConfigin interfaceSpecificationConfig- Parameters:
asyncConfig- TheAsyncConfigto set- Returns:
- An updated RestAssuredMockMvcConfig
-
mockMvcConfig
Set the MockMVC config- Parameters:
mockMvcConfig- TheMockMvcConfigto set- Returns:
- An updated RestAssuredMockMvcConfig
-
multiPartConfig
public RestAssuredMockMvcConfig multiPartConfig(io.restassured.config.MultiPartConfig multiPartConfig) Set the multi-part config- Specified by:
multiPartConfigin interfaceSpecificationConfig- Parameters:
multiPartConfig- TheMultiPartConfigto set- Returns:
- An updated RestAssuredMockMvcConfig
-
getClientConfig
- Specified by:
getClientConfigin interfaceSpecificationConfig
-
clientConfig
- Specified by:
clientConfigin interfaceSpecificationConfig
-
paramConfig
Set the parameter config- Parameters:
paramConfig- TheMockMvcParamConfigto set- Returns:
- An updated RestAssuredMockMvcConfig
-
matcherConfig
Set the matcher config- Specified by:
matcherConfigin interfaceSpecificationConfig- Parameters:
matcherConfig- TheMockMvcParamConfigto set- Returns:
- An updated RestAssuredMockMvcConfig
-
and
Syntactic sugar.- Returns:
- The same RestAssuredMockMvcConfig instance.
-
set
Syntactic sugar.- Returns:
- The same RestAssuredMockMvcConfig instance.
-
with
Syntactic sugar.- Returns:
- The same RestAssuredMockMvcConfig instance.
-
getLogConfig
public io.restassured.config.LogConfig getLogConfig()- Specified by:
getLogConfigin interfaceSpecificationConfig- Returns:
- The LogConfig
-
getEncoderConfig
public io.restassured.config.EncoderConfig getEncoderConfig()- Specified by:
getEncoderConfigin interfaceSpecificationConfig- Returns:
- The EncoderConfig
-
getDecoderConfig
public io.restassured.config.DecoderConfig getDecoderConfig()- Specified by:
getDecoderConfigin interfaceSpecificationConfig- Returns:
- The DecoderConfig
-
getSessionConfig
public io.restassured.config.SessionConfig getSessionConfig()- Specified by:
getSessionConfigin interfaceSpecificationConfig- Returns:
- The SessionConfig
-
getObjectMapperConfig
public io.restassured.config.ObjectMapperConfig getObjectMapperConfig()- Specified by:
getObjectMapperConfigin interfaceSpecificationConfig- Returns:
- The ObjectMapperConfig
-
getJsonConfig
public io.restassured.config.JsonConfig getJsonConfig()- Specified by:
getJsonConfigin interfaceSpecificationConfig- Returns:
- The JsonPath Config
-
getXmlConfig
public io.restassured.config.XmlConfig getXmlConfig()- Specified by:
getXmlConfigin interfaceSpecificationConfig- Returns:
- The Xml Config
-
getHeaderConfig
public io.restassured.config.HeaderConfig getHeaderConfig()- Specified by:
getHeaderConfigin interfaceSpecificationConfig- Returns:
- The Header Config
-
getAsyncConfig
- Specified by:
getAsyncConfigin interfaceSpecificationConfig- Returns:
- The MockMvcAsync Config
-
getMultiPartConfig
public io.restassured.config.MultiPartConfig getMultiPartConfig()- Specified by:
getMultiPartConfigin interfaceSpecificationConfig- Returns:
- The MultiPart Config
-
getParamConfig
public io.restassured.config.ParamConfig getParamConfig()- Specified by:
getParamConfigin interfaceSpecificationConfig- Returns:
- The Param Config
-
paramConfig
- Specified by:
paramConfigin interfaceSpecificationConfig
-
getMockMvcParamConfig
-
getMockMvcConfig
- Returns:
- The MockMvc Config
-
getMatcherConfig
public io.restassured.config.MatcherConfig getMatcherConfig()- Specified by:
getMatcherConfigin interfaceSpecificationConfig- Returns:
- The Matcher Config
-
newConfig
- Returns:
- A static way to create a new RestAssuredMockMvcConfiguration instance without calling "new" explicitly. Mainly for syntactic sugar.
-
config
- Returns:
- A static way to create a new RestAssuredMockMvcConfiguration instance without calling "new" explicitly. Mainly for syntactic sugar.
-
isUserConfigured
public boolean isUserConfigured()- Specified by:
isUserConfiguredin interfaceSpecificationConfig
-