aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.test/tst/org/eclipse
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2023-05-02 13:31:30 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2023-05-03 02:40:41 +0200
commit3d90c4a433f889a755be7cccb639ae16d95fe9a1 (patch)
treedea362d2e6ed1c9b4c4477358377075d6dcdb2f8 /org.eclipse.jgit.http.test/tst/org/eclipse
parent731dfd4c5eb6f88b98e983b9b0551b3562a0c46c (diff)
downloadjgit-3d90c4a433f889a755be7cccb639ae16d95fe9a1.tar.gz
jgit-3d90c4a433f889a755be7cccb639ae16d95fe9a1.zip
Add TransportHttp#getAdditionalHeaders
to enable inspecting which additional HTTP headers have been set on the transport. Change-Id: I0771be9cb7c837de7c203b7f044109b9b2a7d7ad
Diffstat (limited to 'org.eclipse.jgit.http.test/tst/org/eclipse')
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java
index 0ea15d39e5..cda2b32529 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java
@@ -18,6 +18,7 @@ import java.io.IOException;
import java.net.URI;
import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.ServletContextHandler;
@@ -84,8 +85,15 @@ public class SetAdditionalHeadersTest extends AllFactoriesHttpTestCase {
HashMap<String, String> headers = new HashMap<>();
headers.put("Cookie", "someTokenValue=23gBog34");
headers.put("AnotherKey", "someValue");
- ((TransportHttp) t).setAdditionalHeaders(headers);
+
+ @SuppressWarnings("resource")
+ TransportHttp th = (TransportHttp) t;
+ th.setAdditionalHeaders(headers);
t.openFetch();
+
+ Map<String, String> h = th.getAdditionalHeaders();
+ assertEquals("someTokenValue=23gBog34", h.get("Cookie"));
+ assertEquals("someValue", h.get("AnotherKey"));
}
List<AccessEvent> requests = getRequests();