changeset 826:25efe989a99f

HttpMessageModificationFilterTest
author Devel 1
date Fri, 19 Jan 2018 09:18:52 +0100
parents a8fbdb409d7c
children e8a25190d143
files stress-tester/src/test/java/com/passus/st/client/http/filter/HttpMessageModificationFilterTest.java
diffstat 1 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpMessageModificationFilterTest.java	Thu Jan 18 15:51:15 2018 +0100
+++ b/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpMessageModificationFilterTest.java	Fri Jan 19 09:18:52 2018 +0100
@@ -79,30 +79,31 @@
         filter.addOperation(new SetHeaderOperation("Header3", "Header1Value3a"));
         filter.addOperation(new RemoveCookieOperation("myCookie3"));
         filter.addOperation(new AddCookieOperation("myCookie2", "myValue2a"));
-        filter.addOperation(new AddCookieOperation("myCookie4", "myValue4"));
+        filter.addOperation(new AddCookieOperation("myCookie4", "myValue4@"));
         filter.addOperation(new SetCookieOperation("myCookie2", "myValue2ab"));
-        filter.addOperation(new SetCookieOperation("myCookie6", "myValue6"));
+        filter.addOperation(new SetCookieOperation("myCookie6", "myValue6@"));
         filter.addOperation(new PostDataRemoveParamOperation("param3"));
-        filter.addOperation(new PostDataAddParamOperation("param5", "value5"));
+        filter.addOperation(new PostDataAddParamOperation("param5", "value5@"));
         filter.addOperation(new PostDataAddParamOperation("param6", Arrays.asList("value6a", "value6b")));
-        filter.addOperation(new PostDataSetParamOperation("param2", "value2a"));
+        filter.addOperation(new PostDataSetParamOperation("param2", "value2a@"));
         filter.addOperation(new RemoveQueryParameterOperation("uParam1"));
-        filter.addOperation(new SetQueryParameterOperation("uParam2", "2"));
-        filter.addOperation(new AddQueryParameterOperation("uParam2", "2"));
+        filter.addOperation(new SetQueryParameterOperation("uParam2", "2@"));
+        filter.addOperation(new AddQueryParameterOperation("uParam2", "3@"));
+        filter.addOperation(new AddQueryParameterOperation("uParam3", "3@"));
 
         filter.filterOutbound(req, null, null);
 
-        assertEquals("/path/test?uParam2=2", req.getUri().toString());
+        assertEquals("/path/test?uParam2=2%40&uParam3=3%40", req.getUri().toString());
 
         HttpHeaders headers = req.getHeaders();
         assertFalse(headers.contains("Header1"));
         assertEquals("HeaderValue4", headers.get("Header4").toString());
         assertEquals("HeaderValue5", headers.get("Header5").toString());
         assertEquals("Header1Value3a", headers.get("Header3").toString());
-        assertEquals("myCookie1=myValue1;myCookie2=myValue2ab;myCookie4=myValue4;myCookie6=myValue6", headers.get("Cookie").toString());
+        assertEquals("myCookie1=myValue1;myCookie2=myValue2ab;myCookie4=myValue4@;myCookie6=myValue6@", headers.get("Cookie").toString());
 
         HttpParameters params = HttpMessageHelper.get().decodeFormUrlencoded(req);
-        assertEquals("param1=value1&param5=value5&param6=value6a&param6=value6b&param2=value2a", params.toString());
+        assertEquals("param1=value1&param5=value5%40&param6=value6a&param6=value6b&param2=value2a%40", params.toString());
     }
 
     @Test(enabled = true, dataProvider = "contents")