title: Rest assured with digest auth
body: <p>I have a working spring-mvc application with rest services and some rest-assured tests which are fine :</p>
  
  <pre><code>@Test
  public void createFoobarFromScratchReturns201(){
      expect().statusCode(201).given()    
      .queryParam("foo", generateFoo())
      .queryParam("bar", generateBar())
      .when().post("/foo/bar/");
  }
  
  =&gt; OK
  </code></pre>
  
  <p>Then I implemented a <strong>digest</strong> authentication. Everything is working well, now I have to log in to use my services :</p>
  
  <pre><code>curl http://localhost:8089/foo/bar
  =&gt; HTTP ERROR 401,  Full authentication is required to access this resource
  
  curl http://localhost:8089/foo/bar --digest -u user_test:password
  =&gt; HTTP 201, CREATED
  </code></pre>
  
  <p>But when I try to upgrade my tests with the <a href="https://rest-assured.googlecode.com/svn/tags/1.2.3/apidocs/com/jayway/restassured/RestAssured.html#digest(java.lang.String,%20java.lang.String)" rel="nofollow">most obvious function</a>, I still have a 401 error :</p>
  
  <pre><code>@Test
  public void createFoobarFromScratchReturns201(){
      expect().statusCode(201).given()    
      .auth().digest("user_test", "password") // Digest added here
      .queryParam("foo", generateFoo())
      .queryParam("bar", generateBar())
      .when().post("/foo/bar/");
  }
  
  =&gt; Expected status code &lt;201&gt; doesn't match actual status code &lt;401&gt;
  </code></pre>
  
  <p>I found some clues with the <strong>preemptive()</strong> function, but it seems to be only implemented for basic :</p>
  
  <pre><code>// Returns an AuthenticatedScheme and stores it into the general configuration
  RestAssured.authentication = preemptive().basic("user_test", "password");
  
  // Try a similar thing, but it didn't work :
  RestAssured.authentication = RestAssured.digest("user_test", "password");
  </code></pre>
  
  <p>Currently, I am trying to achieve two things :</p>
  
  <ul>
  <li>I need to upgrade a couple of my tests to support digest</li>
  <li>I need to amend the <em>@Before</em> of the rest of my tests suites (whose are not related to auth issues), to be already logged in.</li>
  </ul>
  
  <p>Any ideas or documentation ?</p>