Trying to test the rest api with rest-assured. Getting the error
Invalid number of path parameters. Expected 0, was 3.
public class GetSociailDetails {
@Test
public void generateToken() {
Map<String,String> userDetails = new HashMap<>();
userDetails.put("msISDN", "1217071016");
userDetails.put("messageSource", "TWITTER");
userDetails.put("socialId", "168988132");
given()
.contentType("application/json")
.pathParam("access_token", "LLRPqxvU1uoT8YSl8")
.pathParam("pageNo", "1")
.pathParam("order", "desc")
.body(userDetails)
.post("http://name.com/rest/crm/getdetails")
.then()
.statusCode(200);
}
}
Is there a different way to pass the url params in the rest api which is of POST method.
Instead of
.pathParam("pageNo", "1")
Changed to
.queryParam("pageNo", "1")
This worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With