title: Unit testing controllers with CSRF protection enabled in Spring security
body: <p>Recently we have introduced CSRF protection for our project which uses spring security 3.2.</p>
  
  <p>After enabling CSRF some of the unit tests are failing because of the csrf token is not present in request. I put some dummy value into '_csrf' parameter and it didn't work. </p>
  
  <p>Is there anyway that I can get the csrf token before sending the request (when unit testing)?</p>