title: Do I need to create a new MockMvc for each test?
body: <p>I’m attempting to add <a href="http://cukes.info" rel="nofollow">Cucumber</a> to my Spring Web MVC project which is already using spring-test and JUnit. The non-Cucumber integration tests I’ve already written have the WebApplicationContext autowired in, then created a <code>MockMvc</code> for each test. The <a href="https://github.com/cucumber/cucumber-jvm/blob/master/examples/spring-txn/src/test/java/cucumber/examples/spring/txn/SeeMessagesStepdefs.java" rel="nofollow">Cucumber example</a> I’m trying to work from injects a <code>MockMvc</code> once for the lifetime of the step definition class. </p>
  
  <p>The <a href="https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/test/web/servlet/MockMvc.html" rel="nofollow">API docs for MockMVC</a> don’t give any guidance on how calling <code>perform</code> modifies a <code>MockMvc</code> instance, and whether it’s acceptable to reuse a <code>MockMvc</code> instance for multiple tests. I also wasn’t able to find a definite answer in the <a href="http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/" rel="nofollow">reference docs</a>. </p>
  
  <p>What is the contract with <code>MockMvc</code>? Should I be creating a new one for each test? </p>