Skip to content

Commit

Permalink
Fix issue 14519:Fix spotless issues. Signed-off-by: Vatsal <vatsal.v.…
Browse files Browse the repository at this point in the history
  • Loading branch information
imvtsl committed Jun 26, 2024
1 parent 190a233 commit 0ec7295
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Locale;

import static java.util.Collections.emptyMap;
import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,20 @@ public void testEqualsAndHashcode() {
);
}


public void testFomXContentEmbeddedFoundParsingException() throws IOException {
String json = "{\"_index\":\"foo\",\"_id\":\"bar\"}";
try (XContentParser parser = JsonXContent.jsonXContent
.createParser(NamedXContentRegistry.EMPTY, LoggingDeprecationHandler.INSTANCE, json)) {
try (
XContentParser parser = JsonXContent.jsonXContent.createParser(
NamedXContentRegistry.EMPTY,
LoggingDeprecationHandler.INSTANCE,
json
)
) {
ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.nextToken(), parser);
ParsingException parsingException = assertThrows(ParsingException.class, () -> GetResult.fromXContentEmbedded(parser));
assertEquals("Missing required field [found]", parsingException.getMessage());
}


}

public static GetResult copyGetResult(GetResult getResult) {
Expand Down

0 comments on commit 0ec7295

Please sign in to comment.