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:
parent
3f594089c2
commit
ef2e3a8c39
|
@ -88,6 +88,9 @@ public class Stash implements ToXContent {
|
||||||
*/
|
*/
|
||||||
public Object unstashValue(String value) throws IOException {
|
public Object unstashValue(String value) throws IOException {
|
||||||
if (value.startsWith("$body.")) {
|
if (value.startsWith("$body.")) {
|
||||||
|
if (response == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return response.evaluate(value.substring("$body".length()), this);
|
return response.evaluate(value.substring("$body".length()), this);
|
||||||
}
|
}
|
||||||
Object stashedValue = stash.get(value.substring(1));
|
Object stashedValue = stash.get(value.substring(1));
|
||||||
|
|
|
@ -51,7 +51,11 @@ public class RestResponse {
|
||||||
*/
|
*/
|
||||||
public Object getBody() throws IOException {
|
public Object getBody() throws IOException {
|
||||||
if (isJson()) {
|
if (isJson()) {
|
||||||
return parsedResponse().evaluate("");
|
JsonPath parsedResponse = parsedResponse();
|
||||||
|
if (parsedResponse == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return parsedResponse.evaluate("");
|
||||||
}
|
}
|
||||||
return response.getBody();
|
return response.getBody();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue