@Test
public void testAuthenticate() throws Exception {

    credentials =
        new OAuthCredentials("dpf43f3p2l4k3l03", "nnch734d00sl2jdk", "HMAC-SHA1", "http://photos.example.net/");
    String header = scheme.authenticate(credentials, "get", "http://photos.example.net?file=vacation.jpg");
    assertNotNull(header);
    String regex =
        "OAuth realm=\"[^\"]+\", oauth_consumer_key=\"[^\"]+\", " + "oauth_token=\"[^\"]+\", oauth_signature_method=\"[^\"]+\", oauth_signature=\"[^\"]+\", "
            + "oauth_timestamp=\"[^\"]+\", oauth_nonce=\"[^\"]+\"(, oauth_version=\"[^\"]+\")?";
    assertTrue(header.matches(regex));
}