How to call this endpoint in my Rest Assured Test case

368 Views Asked by At

Post request will generate the recordID like

{

} I want to use the same ID in the below sample get request endpoint after ?recordId=

https://random-query-serv-poc-test-dummy.apps.dev-

How do I write a code to automate this GET Request? I have written this code - but its not working as it is taking the request URI as below

SerenityRest.rest().given().
    header("header1", "ebc").
    header("header2", "svc").
    contentType(ContentType.JSON).
    log().all().
    when().


    then().log().all().
    assertThat().
    statusCode(200);

How can I send the request ID as it is converting the "/" as "%2F"

1

There are 1 best solutions below

0
lucas-nguyen-17 On

You can stop auto URLencode by URL encoding config.

given().urlEncodingEnabled(false)