In the request specification trying to add query params using the Map<String, Object> but after the request spec gets generated any value in th Object is getting converted to String even if the value passed in Int or anything else
public Response postCall(String body, Map<String, Object> queryParams, int id1, int id2) {
RequestSpecification requestSpecification = genericRequestBuilder.getRequestSpecificationObject(); // setting the basepath and portno. and login
// The ids can be send via the queryParams map but in both the cases either in map or individual query, the values are getting converted into String
requestSpecification.queryParams(queryParams);
requestSpecification.queryParam("id1",id1);
requestSpecification.queryParam("id2",id2);
requestSpecification.body(body);
Response response =
requestSpecification.post(uri);
return response;
}
The query parameter changes as noticed in the debug mode:
result = {LinkedHashMap@4245} size = 6
"stringId1" -> "kmpySmUISimoRrJL6NL73w"
"stringId2" -> "YOgB1-WjSKyZWoCkuY7kBA"
"projectIdentifier" -> "1234"
"requestGuid" -> "1594123919225"
"id1" -> "1"
"id2" -> "1"
All the fields are string except the id1 and id2