@@ -0,0 +1,2119 @@
+package com.albroco.barebonesdigest.compatibility;%0A%0Aimport com.albroco.barebonesdigest.DigestChallenge;%0Aimport com.albroco.barebonesdigest.DigestChallengeResponse;%0A%0Aimport org.junit.Test;%0A%0Aimport static com.albroco.barebonesdigest.DigestTestUtils.assertHeadersEqual;%0A%0A/**%0A * Tests that the digest algorithm is compatible with the module %3Ccode%3Enode-http-digest%3C/code%3E%0A * version 0.1.0.%0A *%0A * @see %3Ca href=%22https://github.com/thedjinn/node-http-digest%22%3Enode-http-digest%3C/a%3E%0A */%0Apublic class NodeHttpDigestCompatibilityTest %7B%0A%0A  /**%0A   * Tests that the library is compatible with a server implemented as:%0A   *%0A   * %3Cpre%3E%0A   * %7B@code%0A   * var httpdigest = require('http-digest');%0A   *%0A   * // simple secured web server, unauthenticated requests are not allowed%0A   * httpdigest.createServer(%22theuser%22, %22thepass%22, function(request, response) %7B%0A   * response.writeHead(200, %7B'Content-Type': 'text/html'%7D);%0A   * response.end(%22%3Ch1%3ESecure zone!%3C/h1%3E%22);%0A   * %7D).listen(8000);%0A   * %7D%3C/pre%3E%0A   */%0A  @Test%0A  public void testQopAuthAuthentication() throws Exception %7B%0A    // Tests an actual challenge and compares it to a correct response%0A    DigestChallenge challenge = DigestChallenge.parse(%22Digest realm=%5C%22node-http-digest%5C%22, %22 +%0A        %22qop=%5C%22auth%5C%22, %22 +%0A        %22nonce=%5C%22f50dffb4d7abd8ef3d91bb20ff7fd3a3%5C%22, %22 +%0A        %22opaque=%5C%22666ec9a92102ba3d3add863392842bfa%5C%22%22);%0A%0A    String expectedResponse = %22Digest username=%5C%22theuser%5C%22,%22 +%0A        %22realm=%5C%22node-http-digest%5C%22,%22 +%0A        %22nonce=%5C%22f50dffb4d7abd8ef3d91bb20ff7fd3a3%5C%22,%22 +%0A        %22uri=%5C%22/index.html%5C%22,%22 +%0A        %22response=%5C%22cae25dac1d753c271b9e8d7e515357a8%5C%22,%22 +%0A        %22cnonce=%5C%22da90c03022411abb%5C%22,%22 +%0A        %22opaque=%5C%22666ec9a92102ba3d3add863392842bfa%5C%22,%22 +%0A        %22qop=auth,nc=00000001%22;%0A%0A    DigestChallengeResponse response = DigestChallengeResponse.responseTo(challenge)%0A        .clientNonce(%22da90c03022411abb%22)%0A        .firstRequestClientNonce(%22da90c03022411abb%22)%0A        .username(%22theuser%22)%0A        .password(%22thepass%22)%0A        .digestUri(%22/index.html%22)%0A        .requestMethod(%22GET%22);%0A%0A    assertHeadersEqual(expectedResponse, response.getHeaderValue());%0A  %7D%0A%7D%0A

Add compatibility test with node-http-digest