I have the following validation where I have to check if returned body has a string containing "id": 6354
, but it interprets slashes of special characters. How I can validate strings which contain double quotation marks ?
Code
import static org.hamcrest.Matchers.containsString;
import com.jayway.restassured.response.Response;
response.then()
.body(containsString("\"id\": 6354"));
Error
Response body doesn't match expectation.
Expected: a string containing "\"id\": 6354"
Actual: {...,"id": 6354, ...}
containsString
? – Saunder