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 15:53:45 UTC

[cxf] branch main 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 main
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/main by this push:
     new 33951fce82 Added test case for HTTPConduit's 'http.redirect.allowed.verbs' context property (#994)
33951fce82 is described below

commit 33951fce823c734f03470265697c5d3ef126eed9
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)
---
 .../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<>();