You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2019/04/03 12:18:12 UTC
[cxf] branch master updated: Adding an (empty) HTTP Digest test
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/master by this push:
new 9005703 Adding an (empty) HTTP Digest test
9005703 is described below
commit 90057038bf23efc12df254795ad80c4766c0d2dd
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Wed Apr 3 13:14:32 2019 +0100
Adding an (empty) HTTP Digest test
---
.../httpsignature/JAXRSHTTPSignatureTest.java | 20 ++++++++++++++++++++
.../systest/jaxrs/security/httpsignature/server.xml | 6 ++++++
2 files changed, 26 insertions(+)
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/httpsignature/JAXRSHTTPSignatureTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/httpsignature/JAXRSHTTPSignatureTest.java
index ccaccaa..5e71ae6 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/httpsignature/JAXRSHTTPSignatureTest.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/httpsignature/JAXRSHTTPSignatureTest.java
@@ -74,6 +74,26 @@ public class JAXRSHTTPSignatureTest extends AbstractBusClientServerTestBase {
}
@Test
+ public void testDigest() throws Exception {
+
+ URL busFile = JAXRSHTTPSignatureTest.class.getResource("client.xml");
+
+ //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());
+ client.type("application/xml").accept("application/xml");
+
+ Response response = client.post(new Book("CXF", 126L));
+ assertEquals(response.getStatus(), 200);
+
+ Book returnedBook = response.readEntity(Book.class);
+ assertEquals(126L, returnedBook.getId());
+ }
+
+ @Test
public void testHttpSignature() throws Exception {
URL busFile = JAXRSHTTPSignatureTest.class.getResource("client.xml");
diff --git a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/httpsignature/server.xml b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/httpsignature/server.xml
index d3e819e..9a3b0ef 100644
--- a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/httpsignature/server.xml
+++ b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/httpsignature/server.xml
@@ -34,6 +34,12 @@ under the License.
</cxf:bus>
<bean id="serviceBean" class="org.apache.cxf.systest.jaxrs.security.BookStore"/>
+ <jaxrs:server address="http://localhost:${testutil.ports.jaxrs-httpsignature}/digest">
+ <jaxrs:serviceBeans>
+ <ref bean="serviceBean"/>
+ </jaxrs:serviceBeans>
+ </jaxrs:server>
+
<bean id="publicKeyProvider" class="org.apache.cxf.systest.jaxrs.security.httpsignature.CustomPublicKeyProvider"/>
<bean id="messageVerifier" class="org.apache.cxf.rs.security.httpsignature.MessageVerifier">