Rest tests: More defense around stashing body

Integration tests failed:
https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+multijob-intake/483/console

We'll see if the rest tests were hiding some other failure.
This commit is contained in:
Nik Everett 2016-05-09 09:50:35 -04:00
parent 3f594089c2
commit ef2e3a8c39
2 changed files with 8 additions and 1 deletions

View File

@ -88,6 +88,9 @@ public class Stash implements ToXContent {
*/
public Object unstashValue(String value) throws IOException {
if (value.startsWith("$body.")) {
if (response == null) {
return null;
}
return response.evaluate(value.substring("$body".length()), this);
}
Object stashedValue = stash.get(value.substring(1));

View File

@ -51,7 +51,11 @@ public class RestResponse {
*/
public Object getBody() throws IOException {
if (isJson()) {
return parsedResponse().evaluate("");
JsonPath parsedResponse = parsedResponse();
if (parsedResponse == null) {
return null;
}
return parsedResponse.evaluate("");
}
return response.getBody();
}