CitrusFramework 2.7.6 - Param list support with same param name
In citrus framework till 2.7.5, multiple queryparam could be sent in HttpClientRequestActionBuilder where as in 2.7.6 it could not be it is using Set.
After i looked the source code found that in 2.7.6
public HttpMessage queryParam(String name, String value) {
if (!StringUtils.hasText(name)) {
throw new CitrusRuntimeException("Invalid query param name - must not be empty!");
}
this.queryParams.put(name, value);
String queryParamString = queryParams.entrySet()
.stream()
.map(entry -> entry.getKey() + (entry.getValue() != null ? "=" + entry.getValue() : ""))
.collect(Collectors.joining(","));
header(HttpMessageHeaders.HTTP_QUERY_PARAMS, queryParamString);
header(DynamicEndpointUriResolver.QUERY_PARAM_HEADER_NAME, queryParamString);
return this;
}
where as in release prior to 2.7.6 it was
public HttpMessage queryParam(String name, String value) {
if (!StringUtils.hasText(name)) {
throw new CitrusRuntimeException("Invalid query param name - must not be empty!");
}
String queryParams;
if (getHeader(HttpMessageHeaders.HTTP_QUERY_PARAMS) != null) {
queryParams = getHeader(HttpMessageHeaders.HTTP_QUERY_PARAMS).toString();
queryParams += "," + name + (StringUtils.hasText(value) ? "=" + value : "");
} else {
queryParams = name + (StringUtils.hasText(value) ? "=" + value : "");
}
header(HttpMessageHeaders.HTTP_QUERY_PARAMS, queryParams);
header(DynamicEndpointUriResolver.QUERY_PARAM_HEADER_NAME, queryParams);
return this;
}
As a result if i use queryParam("paramName", "value1").queryParam("paramName", "value2") then only paramName with "Value1" is sent not "value2".
May I ask why this feature is removed or is there any workaround available?
citrus-framework
add a comment |
In citrus framework till 2.7.5, multiple queryparam could be sent in HttpClientRequestActionBuilder where as in 2.7.6 it could not be it is using Set.
After i looked the source code found that in 2.7.6
public HttpMessage queryParam(String name, String value) {
if (!StringUtils.hasText(name)) {
throw new CitrusRuntimeException("Invalid query param name - must not be empty!");
}
this.queryParams.put(name, value);
String queryParamString = queryParams.entrySet()
.stream()
.map(entry -> entry.getKey() + (entry.getValue() != null ? "=" + entry.getValue() : ""))
.collect(Collectors.joining(","));
header(HttpMessageHeaders.HTTP_QUERY_PARAMS, queryParamString);
header(DynamicEndpointUriResolver.QUERY_PARAM_HEADER_NAME, queryParamString);
return this;
}
where as in release prior to 2.7.6 it was
public HttpMessage queryParam(String name, String value) {
if (!StringUtils.hasText(name)) {
throw new CitrusRuntimeException("Invalid query param name - must not be empty!");
}
String queryParams;
if (getHeader(HttpMessageHeaders.HTTP_QUERY_PARAMS) != null) {
queryParams = getHeader(HttpMessageHeaders.HTTP_QUERY_PARAMS).toString();
queryParams += "," + name + (StringUtils.hasText(value) ? "=" + value : "");
} else {
queryParams = name + (StringUtils.hasText(value) ? "=" + value : "");
}
header(HttpMessageHeaders.HTTP_QUERY_PARAMS, queryParams);
header(DynamicEndpointUriResolver.QUERY_PARAM_HEADER_NAME, queryParams);
return this;
}
As a result if i use queryParam("paramName", "value1").queryParam("paramName", "value2") then only paramName with "Value1" is sent not "value2".
May I ask why this feature is removed or is there any workaround available?
citrus-framework
add a comment |
In citrus framework till 2.7.5, multiple queryparam could be sent in HttpClientRequestActionBuilder where as in 2.7.6 it could not be it is using Set.
After i looked the source code found that in 2.7.6
public HttpMessage queryParam(String name, String value) {
if (!StringUtils.hasText(name)) {
throw new CitrusRuntimeException("Invalid query param name - must not be empty!");
}
this.queryParams.put(name, value);
String queryParamString = queryParams.entrySet()
.stream()
.map(entry -> entry.getKey() + (entry.getValue() != null ? "=" + entry.getValue() : ""))
.collect(Collectors.joining(","));
header(HttpMessageHeaders.HTTP_QUERY_PARAMS, queryParamString);
header(DynamicEndpointUriResolver.QUERY_PARAM_HEADER_NAME, queryParamString);
return this;
}
where as in release prior to 2.7.6 it was
public HttpMessage queryParam(String name, String value) {
if (!StringUtils.hasText(name)) {
throw new CitrusRuntimeException("Invalid query param name - must not be empty!");
}
String queryParams;
if (getHeader(HttpMessageHeaders.HTTP_QUERY_PARAMS) != null) {
queryParams = getHeader(HttpMessageHeaders.HTTP_QUERY_PARAMS).toString();
queryParams += "," + name + (StringUtils.hasText(value) ? "=" + value : "");
} else {
queryParams = name + (StringUtils.hasText(value) ? "=" + value : "");
}
header(HttpMessageHeaders.HTTP_QUERY_PARAMS, queryParams);
header(DynamicEndpointUriResolver.QUERY_PARAM_HEADER_NAME, queryParams);
return this;
}
As a result if i use queryParam("paramName", "value1").queryParam("paramName", "value2") then only paramName with "Value1" is sent not "value2".
May I ask why this feature is removed or is there any workaround available?
citrus-framework
In citrus framework till 2.7.5, multiple queryparam could be sent in HttpClientRequestActionBuilder where as in 2.7.6 it could not be it is using Set.
After i looked the source code found that in 2.7.6
public HttpMessage queryParam(String name, String value) {
if (!StringUtils.hasText(name)) {
throw new CitrusRuntimeException("Invalid query param name - must not be empty!");
}
this.queryParams.put(name, value);
String queryParamString = queryParams.entrySet()
.stream()
.map(entry -> entry.getKey() + (entry.getValue() != null ? "=" + entry.getValue() : ""))
.collect(Collectors.joining(","));
header(HttpMessageHeaders.HTTP_QUERY_PARAMS, queryParamString);
header(DynamicEndpointUriResolver.QUERY_PARAM_HEADER_NAME, queryParamString);
return this;
}
where as in release prior to 2.7.6 it was
public HttpMessage queryParam(String name, String value) {
if (!StringUtils.hasText(name)) {
throw new CitrusRuntimeException("Invalid query param name - must not be empty!");
}
String queryParams;
if (getHeader(HttpMessageHeaders.HTTP_QUERY_PARAMS) != null) {
queryParams = getHeader(HttpMessageHeaders.HTTP_QUERY_PARAMS).toString();
queryParams += "," + name + (StringUtils.hasText(value) ? "=" + value : "");
} else {
queryParams = name + (StringUtils.hasText(value) ? "=" + value : "");
}
header(HttpMessageHeaders.HTTP_QUERY_PARAMS, queryParams);
header(DynamicEndpointUriResolver.QUERY_PARAM_HEADER_NAME, queryParams);
return this;
}
As a result if i use queryParam("paramName", "value1").queryParam("paramName", "value2") then only paramName with "Value1" is sent not "value2".
May I ask why this feature is removed or is there any workaround available?
citrus-framework
citrus-framework
edited Nov 29 '18 at 7:38
VIBHU
asked Nov 22 '18 at 6:54
VIBHUVIBHU
12
12
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53425364%2fcitrusframework-2-7-6-param-list-support-with-same-param-name%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53425364%2fcitrusframework-2-7-6-param-list-support-with-same-param-name%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown