modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/RestAssuredMockMvc.java
public static MockMvcAuthenticationScheme with(final RequestPostProcessor requestPostProcessor, final RequestPostProcessor... additionalRequestPostProcessor) {
        return new MockMvcAuthenticationScheme() {
            public void authenticate(MockMvcRequestSpecification mockMvcRequestSpecification) {
                mockMvcRequestSpecification.auth().with(requestPostProcessor, additionalRequestPostProcessor);
            }
        };
    }
public static MockMvcAuthenticationScheme with(final RequestPostProcessor requestPostProcessor, final RequestPostProcessor... additionalRequestPostProcessor) {
        return new MockMvcAuthenticationScheme() {
            public void authenticate(MockMvcRequestSpecification mockMvcRequestSpecification) {
                mockMvcRequestSpecification.auth().with(requestPostProcessor, additionalRequestPostProcessor);
            }
        };
    }
public static MockMvcAuthenticationScheme with ( final RequestPostProcessor requestPostProcessor , final RequestPostProcessor ... additionalRequestPostProcessor ) { return new MockMvcAuthenticationScheme ( ) { public void authenticate ( MockMvcRequestSpecification mockMvcRequestSpecification ) { mockMvcRequestSpecification . auth ( ) . with ( requestPostProcessor , additionalRequestPostProcessor ) ; } } ; }
Authenticate using a {@link RequestPostProcessor}.
This is mainly useful when you have added the <code>spring-security-test</code> artifact to classpath. This allows
you to do for example:
<pre>
RestAssured.authentication = with(user("username").password("password"));
</pre>
where <code>user</code> is statically imported from <code>org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors</code>.

@param requestPostProcessor           The first request post processor to be used for authentication
@param additionalRequestPostProcessor Additional request post processors to be used for authentication
@return A {@link MockMvcAuthenticationScheme} instance.
Authenticate using a { @link RequestPostProcessor } . This is mainly useful when you have added the <code > spring - security - test< / code > artifact to classpath . This allows you to do for example : <pre > RestAssured . authentication = with ( user ( username ) . password ( password )) ; < / pre > where <code > user< / code > is statically imported from <code > org . springframework . security . test . web . servlet . request . SecurityMockMvcRequestPostProcessors< / code > .