cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [4/4] cxf git commit: Fixing tests
Date Tue, 28 Mar 2017 12:13:19 GMT
Fixing tests


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0ffcd507
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0ffcd507
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0ffcd507

Branch: refs/heads/master
Commit: 0ffcd507e0f7bc5c33ddb819a474426035948c6d
Parents: 9c6f0b8
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Mar 28 13:10:51 2017 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Mar 28 13:10:51 2017 +0100

----------------------------------------------------------------------
 .../jaxrs/security/xml/JAXRSXmlSecTest.java     | 26 ++++++++------------
 1 file changed, 10 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/0ffcd507/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
index 6942508..67abc0c 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
@@ -279,7 +279,7 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase {
             if (!useKeyInfo) {
                 sigInInterceptor.setSignatureVerificationAlias("alice");
             }
-            bean.getInInterceptors().add(sigInInterceptor);
+            bean.setProvider(sigInInterceptor);
         } else {
             XmlSigOutInterceptor sigOutInterceptor = new XmlSigOutInterceptor();
             if (enveloping) {
@@ -295,19 +295,13 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase
{
 
         WebClient wc = bean.createWebClient();
         WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000L);
-        try {
-            Book book;
-            if (!fromResponse) {
-                book = wc.post(new Book("CXF", 126L), Book.class);
-            } else {
-                book = wc.post(new Book("CXF", 126L)).readEntity(Book.class);
-            }
-            assertEquals(126L, book.getId());
-        } catch (WebApplicationException ex) {
-            fail(ex.getMessage());
-        } catch (ProcessingException ex) {
-            assertTrue(ex.getCause() instanceof BadRequestException);
+        Book book;
+        if (!fromResponse) {
+            book = wc.post(new Book("CXF", 126L), Book.class);
+        } else {
+            book = wc.post(new Book("CXF", 126L)).readEntity(Book.class);
         }
+        assertEquals(126L, book.getId());
     }
 
     @Test
@@ -336,7 +330,7 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase {
 
             XmlSecInInterceptor sigInInterceptor = new XmlSecInInterceptor();
             sigInInterceptor.setRequireSignature(true);
-            bean.getInInterceptors().add(sigInInterceptor);
+            bean.setProvider(sigInInterceptor);
         } else {
             XmlSigOutInterceptor sigOutInterceptor = new XmlSigOutInterceptor();
             bean.getOutInterceptors().add(sigOutInterceptor);
@@ -381,7 +375,7 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase {
 
             XmlSecInInterceptor sigInInterceptor = new XmlSecInInterceptor();
             sigInInterceptor.setRequireSignature(true);
-            bean.getInInterceptors().add(sigInInterceptor);
+            bean.setProvider(sigInInterceptor);
         } else {
             XmlSigOutInterceptor sigOutInterceptor = new XmlSigOutInterceptor();
             bean.getOutInterceptors().add(sigOutInterceptor);
@@ -577,7 +571,7 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase {
 
             XmlSecInInterceptor encInInterceptor = new XmlSecInInterceptor();
             encInInterceptor.setRequireEncryption(true);
-            bean.getInInterceptors().add(encInInterceptor);
+            bean.setProvider(encInInterceptor);
         } else {
             if (sign) {
                 bean.getOutInterceptors().add(new XmlSigOutInterceptor());


Mime
View raw message