Skip to content

Commit 23f6a11

Browse files
committed
Make text() also call optimisedText() some times
1 parent 3cf40d3 commit 23f6a11

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

libs/x-content/impl/src/test/java/org/elasticsearch/xcontent/provider/json/ESUTF8StreamJsonParserTests.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,15 @@ static TestXContentParser create(String input) throws IOException {
373373
return new TestXContentParser(new JsonXContentParser(XContentParserConfigurationImpl.EMPTY, parser));
374374
}
375375

376+
@Override
377+
public String text() throws IOException {
378+
if (randomIntBetween(0, 9) < 8) {
379+
return super.text();
380+
} else {
381+
return super.optimizedText().string();
382+
}
383+
}
384+
376385
@Override
377386
public XContentString optimizedText() throws IOException {
378387
int extraCalls = randomIntBetween(0, 5);

0 commit comments

Comments
 (0)