I'm writing a unit test case, in which I'm not able to compare two strings only because of </>
tag inside the object.
My output is
{"description":"<p>License forms information can be download as attachments<\/p>"}
My expected output is:
"{\"description\":\"<p>License forms information can be download as attachments</p>\"}";
The only place where I'm facing problem is at </p>
tag. When I change to <\/p>
it throws me syntax error. Any suggestions would be greatly appreciated.
My code
WebResource webResource = client.resource("http://myip:8080/Kalgudi/restService");
ClientResponse response = webResource.type("application/xml").get(ClientResponse.class);
String output = response.getEntity(String.class);
JSONObject json = new JSONObject(output);
System.out.println("Json object is:"+json.getJSONObject("6824"));
String expected = "{\"description\":\"<p>License forms information can be download as attachments</p>\"}";
assertEquals(expected, json.getJSONObject("6824"));