public class MockMvcConfig extends Object implements ClientConfig, io.restassured.config.Config
Constructor and Description |
---|
MockMvcConfig()
Creates a default
MockMvcConfig that automatically applies the SecurityMockMvcConfigurer if available in classpath. |
Modifier and Type | Method and Description |
---|---|
MockMvcConfig |
automaticallyApplySpringRestDocsMockMvcSupport()
Instruct REST Assured Mock Mvc to automatically apply support for
spring-restdocs-mockmvc if it's available in the classpath. |
MockMvcConfig |
automaticallyApplySpringRestDocsMockMvcSupport(boolean automaticallyApplySpringRestDocsMockMvcSupport)
Instructs REST Assured whether or not to automatically support
spring-restdocs-mockmvc if available in classpath. |
MockMvcConfig |
automaticallyApplySpringSecurityMockMvcConfigurer()
Instruct REST Assured Mock Mvc to automatically apply the SpringSecurityMockMvcConfigurer if it's available in the classpath.
|
MockMvcConfig |
automaticallyApplySpringSecurityMockMvcConfigurer(boolean shouldAutomaticallyApplySpringSecurityMockMvcConfigurer)
Instructs REST Assured to automatically apply the SecurityMockMvcConfigurer that allows for Spring Security testing.
|
MockMvcConfig |
dontAutomaticallyApplySpringRestDocsMockMvcSupport()
Instruct REST Assured Mock Mvc not to automatically apply support for
spring-restdocs-mockmvc even if it's available in the classpath. |
MockMvcConfig |
dontAutomaticallyApplySpringSecurityMockMvcConfigurer()
Instruct REST Assured Mock Mvc not to automatically apply the SpringSecurityMockMvcConfigurer even if it's available in the classpath.
|
boolean |
isUserConfigured() |
static MockMvcConfig |
mockMvcConfig()
Just syntactic sugar.
|
boolean |
shouldAutomaticallyApplySpringRestDocsMockMvcSupport() |
boolean |
shouldAutomaticallyApplySpringSecurityMockMvcConfigurer() |
MockMvcConfig |
with()
Just syntactic sugar to make the DSL more english like.
|
public MockMvcConfig()
MockMvcConfig
that automatically applies the SecurityMockMvcConfigurer
if available in classpath.public MockMvcConfig dontAutomaticallyApplySpringSecurityMockMvcConfigurer()
public MockMvcConfig dontAutomaticallyApplySpringRestDocsMockMvcSupport()
spring-restdocs-mockmvc
even if it's available in the classpath.public MockMvcConfig automaticallyApplySpringSecurityMockMvcConfigurer(boolean shouldAutomaticallyApplySpringSecurityMockMvcConfigurer)
spring-security-test
is in the classpath and you've configured Rest Assured Mock MVC an instance of AbstractMockMvcBuilder
.
For example by using MockMvcRequestSpecification.webAppContextSetup(WebApplicationContext, MockMvcConfigurer...)
or
MockMvcRequestSpecification.standaloneSetup(MockMvcBuilder)
.shouldAutomaticallyApplySpringSecurityMockMvcConfigurer
- true
if SecurityMockMvcConfigurer should be automatically applied if available in classpath, false
otherwise.MockMvcConfig
.public MockMvcConfig automaticallyApplySpringRestDocsMockMvcSupport(boolean automaticallyApplySpringRestDocsMockMvcSupport)
spring-restdocs-mockmvc
if available in classpath.automaticallyApplySpringRestDocsMockMvcSupport
- true
if Spring Rest Docs MockMvc support should be automatically applied if available in classpath, false
otherwise.MockMvcConfig
.public MockMvcConfig automaticallyApplySpringSecurityMockMvcConfigurer()
MockMvcConfig
.automaticallyApplySpringSecurityMockMvcConfigurer(boolean)
public MockMvcConfig automaticallyApplySpringRestDocsMockMvcSupport()
spring-restdocs-mockmvc
if it's available in the classpath.MockMvcConfig
.automaticallyApplySpringRestDocsMockMvcSupport(boolean)
public boolean shouldAutomaticallyApplySpringSecurityMockMvcConfigurer()
public boolean shouldAutomaticallyApplySpringRestDocsMockMvcSupport()
spring-restdocs-mockmvc
if it's available in classpathpublic boolean isUserConfigured()
isUserConfigured
in interface io.restassured.config.Config
isUserConfigured
in interface ClientConfig
public MockMvcConfig with()
public static MockMvcConfig mockMvcConfig()
MockMvcConfig
.Copyright © 2010–2020. All rights reserved.