Skip to content

Commit

Permalink
Add missing change in test/ tree
Browse files Browse the repository at this point in the history
  • Loading branch information
tvernum committed Nov 23, 2020
1 parent 4bdc335 commit d2a2246
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ private XContentTestUtils() {

public static Map<String, Object> convertToMap(ToXContent part) throws IOException {
XContentBuilder builder = XContentFactory.jsonBuilder();
builder.startObject();
part.toXContent(builder, EMPTY_PARAMS);
builder.endObject();
if (part.isFragment()) {
builder.startObject();
part.toXContent(builder, EMPTY_PARAMS);
builder.endObject();
} else {
part.toXContent(builder, EMPTY_PARAMS);
}
return XContentHelper.convertToMap(BytesReference.bytes(builder), false, builder.contentType()).v2();
}

Expand Down

0 comments on commit d2a2246

Please sign in to comment.