You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2022/09/02 19:01:43 UTC

[cxf] branch 3.4.x-fixes updated: Added test case for HTTPConduit's 'http.redirect.allowed.verbs' context property (#994)

This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/3.4.x-fixes by this push:
     new 91668c1d43 Added test case for HTTPConduit's 'http.redirect.allowed.verbs' context property (#994)
91668c1d43 is described below

commit 91668c1d43713742c5b64a964bda4491b104a5ae
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Fri Sep 2 11:53:38 2022 -0400

    Added test case for HTTPConduit's 'http.redirect.allowed.verbs' context property (#994)
    
    (cherry picked from commit 33951fce823c734f03470265697c5d3ef126eed9)
    (cherry picked from commit 17481bf9926b13f1800db86106561939c30701d3)
    (cherry picked from commit 637d68276a0971bc117f6c1876ed78fbdc6ad235)
---
 .../cxf/transport/http/HTTPConduitURLEasyMockTest.java     | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java b/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java
index 1adcff5a36..c63aff92eb 100644
--- a/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java
+++ b/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java
@@ -291,6 +291,20 @@ public class HTTPConduitURLEasyMockTest {
         finalVerify();
     }
 
+    @Test
+    public void testSendHttpConnectionAllowedRedirectVerbs() throws Exception {
+        control = EasyMock.createNiceControl();
+        HTTPConduit conduit = setUpConduit(true, false, "POST");
+        Message message = createMessage();
+        message.put("http.redirect.allowed.verbs", "POST");
+        message.put(HTTPConduit.SET_HTTP_RESPONSE_MESSAGE, Boolean.TRUE);
+        conduit.prepare(message);
+        conduit.getClient().setAutoRedirect(true);
+        verifySentMessage(conduit, message, "POST");
+        assertEquals(HTTP_RESPONSE_MESSAGE, inMessage.get(HTTPConduit.HTTP_RESPONSE_MESSAGE));
+        finalVerify();
+    }
+
     private void setUpHeaders(Message message) {
         Map<String, List<String>> headers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
         List<String> contentTypes = new ArrayList<>();