[TESTS] Fix GetResultTests.testGetSourceAsBytes() (#22524)

The document in the randomized GetResult can exist with no source (like if the _source was disabled in mappings), that's why the test should not always expect a non null source when the doc exists.
This commit is contained in:
Tanguy Leroux 2017-01-10 13:12:00 +01:00 committed by GitHub
parent 433c822d4f
commit b9061c1cc9
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ public class GetResultTests extends ESTestCase {
XContentType xContentType = randomFrom(XContentType.values());
Tuple<GetResult, GetResult> tuple = randomGetResult(xContentType);
GetResult getResult = tuple.v1();
if (getResult.isExists()) {
if (getResult.isExists() && getResult.isSourceEmpty() == false) {
assertNotNull(getResult.sourceRef());
} else {
assertNull(getResult.sourceRef());