I am using rest-assured to test api.
one of the api expected result format is like "Store <b>"+StoreName+"</b> created successfully"
.
but the actual result is coming with some encoding, i am not sure what encoding they are using.
example: Store name is " abc&*()_-+=~/?'abc
then i am expecting result as Store <b>abc&*()_-+=~/?'abc</b> created successfully
but it is coming as Store \u003cb\u003eabc\u0026*()_-+\u003d~/?\u0027abc\u003c/b\u003e created successfully"
How to encode my expected result, so that i compare the expected with actual.
I want to convert the expected result only, because the conversion will be at single place.
to Convert actual result to expected result, i have solution as follows:
org.apache.commons.lang3.StringEscapeUtils.unescapeJava("Store \u003cb\u003eabc\u0026*()_-+\u003d~/?\u0027abc\u003c/b\u003e created successfully")
result will come as Store <b>abc&*()_-+=~/?'abc</b> created successfully
but i want to convert my expected result to actual result so that code will be at single place.