I have a huge JSON file to be POST as payload of a rest api call for testing purposes. I tried something like :
public void RestTest() throws Exception {
File file = new File("/Users/bmishra/Code_Center/stash/experiments/src/main/resources/Search.json");
String content = null;
given().body(file).with().contentType("application/json").then().expect().
statusCode(200).
body(equalTo("true")).when().post("http://devsearch");
}
and get error as :
java.lang.UnsupportedOperationException: Internal error: Can't encode /Users/bmishra/Code_Center/stash/experiments/src/main/resources/Search.json to JSON.
json
java.lang.UnsupportedOperationException: Internal error: Can't encode /Users/bmishra/Code_Center/stash/experiments/src/main/resources/Search.json to JSON.
I can run by reading the file and passing the body as string and that works but I see i can directly pass the file object and this doesnt work.
--
You received this message because you are subscribed to the Google Groups "REST assured" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "REST assured" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.