Skip to content
Permalink
Browse files
fix bug in filter, activate filter in test
Signed-off-by: David J. M. Karlsen <david@davidkarlsen.com>
  • Loading branch information
davidkarlsen committed Apr 3, 2019
1 parent 47ee9bd commit 80c949f1c738b062bcb992b0dfb8714f8851c006
Showing 2 changed files with 5 additions and 3 deletions.
@@ -62,5 +62,7 @@ public void aroundWriteTo(WriterInterceptorContext context) throws IOException {
new String(cacheAndWriteOutputStream.getBytes(), encoding), digestAlgorithmName);
context.getHeaders().add(DIGEST_HEADER_NAME, digest);
}

context.proceed();
}
}
@@ -47,6 +47,7 @@
import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.cxf.rs.security.httpsignature.MessageSigner;
import org.apache.cxf.rs.security.httpsignature.MessageVerifier;
import org.apache.cxf.rs.security.httpsignature.filters.CreateDigestInterceptor;
import org.apache.cxf.rs.security.httpsignature.filters.CreateSignatureClientFilter;
import org.apache.cxf.rs.security.httpsignature.filters.VerifySignatureClientFilter;
import org.apache.cxf.rt.security.rs.PrivateKeyPasswordProvider;
@@ -78,12 +79,11 @@ public void testDigest() throws Exception {

URL busFile = JAXRSHTTPSignatureTest.class.getResource("client.xml");

//CreateDigestInterceptor digestFilter = new CreateDigestInterceptor();
CreateDigestInterceptor digestFilter = new CreateDigestInterceptor();

String address = "http://localhost:" + PORT + "/digest/bookstore/books";
WebClient client =
// WebClient.create(address, Collections.singletonList(digestFilter), busFile.toString());
WebClient.create(address, busFile.toString());
WebClient.create(address, Collections.singletonList(digestFilter), busFile.toString());
client.type("application/xml").accept("application/xml");

Response response = client.post(new Book("CXF", 126L));

0 comments on commit 80c949f

Please sign in to comment.