Mercurial > stress-tester
changeset 613:e38011acae15
switching to HttpMessageHelper.get() + bugfix
author | Devel 1 |
---|---|
date | Mon, 09 Oct 2017 15:28:51 +0200 |
parents | 7fd0b286b240 |
children | 50ef5ab06550 |
files | stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMessageModificationFilter.java |
diffstat | 1 files changed, 12 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMessageModificationFilter.java Mon Oct 09 14:55:37 2017 +0200 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMessageModificationFilter.java Mon Oct 09 15:28:51 2017 +0200 @@ -190,7 +190,7 @@ @Override protected void doProcess(CharSequence name, HttpRequest req, HttpResponse resp, HttpFlowContext context) { - HELPER.removeCookie(req, name); + HttpMessageHelper.get().removeCookie(req, name); } } @@ -207,7 +207,7 @@ @Override protected void doProcess(CharSequence value, HttpRequest req, HttpResponse resp, HttpFlowContext context) { - HELPER.addCookie(req, name, value); + HttpMessageHelper.get().addCookie(req, name, value); } } @@ -224,7 +224,7 @@ @Override protected void doProcess(CharSequence value, HttpRequest req, HttpResponse resp, HttpFlowContext context) { - HELPER.setCookie(req, name, value); + HttpMessageHelper.get().setCookie(req, name, value); } } @@ -242,7 +242,7 @@ @Override protected void doProcess(CharSequence name, HttpRequest req, HttpResponse resp, HttpFlowContext context) { try { - HELPER.removeQueryParameter(req, name); + HttpMessageHelper.get().removeQueryParameter(req, name); } catch (ParseException ex) { if (LOGGER.isDebugEnabled()) { LOGGER.debug(ex.getMessage(), ex); @@ -265,7 +265,7 @@ @Override protected void doProcess(CharSequence value, HttpRequest req, HttpResponse resp, HttpFlowContext context) { try { - HELPER.addQueryParameter(req, name, value); + HttpMessageHelper.get().addQueryParameter(req, name, value); } catch (ParseException ex) { if (LOGGER.isDebugEnabled()) { LOGGER.debug(ex.getMessage(), ex); @@ -288,7 +288,7 @@ @Override protected void doProcess(CharSequence value, HttpRequest req, HttpResponse resp, HttpFlowContext context) { try { - HELPER.setQueryParameter(req, name, value); + HttpMessageHelper.get().setQueryParameter(req, name, value); } catch (ParseException ex) { if (LOGGER.isDebugEnabled()) { LOGGER.debug(ex.getMessage(), ex); @@ -400,9 +400,9 @@ @Override protected void doProcess(CharSequence value, HttpRequest req, HttpResponse resp, HttpFlowContext context) { try { - HttpParameters params = HELPER.decodeFormUrlencoded(req); + HttpParameters params = HttpMessageHelper.get().decodeFormUrlencoded(req); if (doRemove(params, req, resp, context)) { - HELPER.setFormUrlencoded(req, params); + HttpMessageHelper.get().setFormUrlencoded(req, params); } } catch (Exception e) { if (LOGGER.isDebugEnabled()) { @@ -426,9 +426,9 @@ @Override public void process(HttpRequest req, HttpResponse resp, HttpFlowContext context) { try { - HttpParameters params = HELPER.decodeFormUrlencoded(req); + HttpParameters params = HttpMessageHelper.get().decodeFormUrlencoded(req); doAdd(params, req, resp, context); - HELPER.setFormUrlencoded(req, params); + HttpMessageHelper.get().setFormUrlencoded(req, params); } catch (Exception e) { if (LOGGER.isDebugEnabled()) { LOGGER.debug(e.getMessage(), e); @@ -451,9 +451,9 @@ @Override public void process(HttpRequest req, HttpResponse resp, HttpFlowContext context) { try { - HttpParameters params = HELPER.decodeFormUrlencoded(req); + HttpParameters params = HttpMessageHelper.get().decodeFormUrlencoded(req); doSet(params, req, resp, context); - HELPER.setFormUrlencoded(req, params); + HttpMessageHelper.get().setFormUrlencoded(req, params); } catch (Exception e) { if (LOGGER.isDebugEnabled()) { LOGGER.debug(e.getMessage(), e); @@ -465,8 +465,6 @@ private final List<Operation> operations = new ArrayList<>(); - private static final HttpMessageHelper HELPER = new HttpMessageHelper(true); // used in outbound only, instance per filter is OK - private HttpMessagePredicate predicate; public HttpMessagePredicate getPredicate() {