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 2017/03/28 14:38:16 UTC
[4/6] cxf git commit: Fixing tests
Fixing tests
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6386e377
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6386e377
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6386e377
Branch: refs/heads/3.0.x-fixes
Commit: 6386e3772dffdf08d72d0eab204ca38001c72387
Parents: 7cee545
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Tue Mar 28 13:10:51 2017 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Tue Mar 28 14:35:32 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/6386e377/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 f4218ec..1cc5ad2 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
@@ -244,7 +244,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) {
@@ -260,19 +260,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
@@ -301,7 +295,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);
@@ -346,7 +340,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);
@@ -542,7 +536,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());