This is an automated email from the ASF dual-hosted git repository.
ffang 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 d4a28ed [CXF-8062]test to demonstrate
MessageContext.HTTP_RESPONSE_CODE can be obtained if response code is not 200
d4a28ed is described below
commit d4a28ed9d3d1f136263565516accfae9366c41b2
Author: Freeman Fang <[email protected]>
AuthorDate: Fri Jun 28 12:38:38 2019 -0400
[CXF-8062]test to demonstrate MessageContext.HTTP_RESPONSE_CODE can be
obtained if response code is not 200
---
.../src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git
a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
index 89262fa..912aa8a 100644
---
a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
+++
b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
@@ -48,6 +48,7 @@ import javax.xml.ws.Endpoint;
import javax.xml.ws.Response;
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.soap.SOAPFaultException;
import org.w3c.dom.Document;
@@ -726,6 +727,9 @@ public class ClientServerTest extends
AbstractBusClientServerTestBase {
greeter.testDocLitFault(noSuchCodeFault);
fail("Should have thrown NoSuchCodeLitFault exception");
} catch (NoSuchCodeLitFault nslf) {
+ int responseCode = (Integer) ((BindingProvider)
greeter).getResponseContext().get(
+ MessageContext.HTTP_RESPONSE_CODE);
+ assertEquals(responseCode, 500);
assertNotNull(nslf.getFaultInfo());
assertNotNull(nslf.getFaultInfo().getCode());
}