|
20 | 20 | package co.elastic.clients.json.jackson;
|
21 | 21 |
|
22 | 22 | import co.elastic.clients.elasticsearch.core.MsearchResponse;
|
23 |
| -import co.elastic.clients.testkit.ModelTestCase; |
24 | 23 | import co.elastic.clients.json.JsonpDeserializer;
|
25 | 24 | import co.elastic.clients.json.JsonpMapper;
|
| 25 | +import co.elastic.clients.testkit.ModelTestCase; |
26 | 26 | import jakarta.json.stream.JsonParser;
|
27 | 27 | import jakarta.json.stream.JsonParser.Event;
|
28 | 28 | import org.junit.jupiter.api.Test;
|
|
31 | 31 |
|
32 | 32 | public class JacksonJsonpParserTest extends ModelTestCase {
|
33 | 33 |
|
34 |
| - private static final String json = "{ 'foo': 'fooValue', 'bar': { 'baz': 1}, 'quux': [true] }".replace('\'', '"'); |
| 34 | + private static final String json = |
| 35 | + "{ 'foo': 'fooValue', 'bar': { 'baz': 1}, 'quux': [true] }".replace('\'', '"'); |
35 | 36 |
|
36 | 37 | @Test
|
37 | 38 | public void testEventStream() {
|
@@ -93,12 +94,13 @@ public void testForbidValueGettersAfterHasNext() {
|
93 | 94 | try {
|
94 | 95 | assertEquals("fooValue", parser.getString());
|
95 | 96 | fail();
|
96 |
| - } catch(IllegalStateException e) { |
| 97 | + } catch (IllegalStateException e) { |
97 | 98 | // expected
|
98 | 99 | }
|
99 | 100 | }
|
100 | 101 |
|
101 |
| - @Test void testMultiSearchResponse() { |
| 102 | + @Test |
| 103 | + void testMultiSearchResponse() { |
102 | 104 | String json =
|
103 | 105 | "{\n" +
|
104 | 106 | " \"took\" : 1,\n" +
|
@@ -157,7 +159,8 @@ public void testForbidValueGettersAfterHasNext() {
|
157 | 159 | "}\n";
|
158 | 160 |
|
159 | 161 | JsonpMapper mapper = new JacksonJsonpMapper();
|
160 |
| - mapper = mapper.withAttribute("co.elastic.clients:Deserializer:_global.msearch.Response.TDocument", JsonpDeserializer.of(Foo.class)); |
| 162 | + mapper = mapper.withAttribute("co.elastic.clients:Deserializer:_global.msearch.Response.TDocument", |
| 163 | + JsonpDeserializer.of(Foo.class)); |
161 | 164 | @SuppressWarnings("unchecked")
|
162 | 165 | MsearchResponse<Foo> response = fromJson(json, MsearchResponse.class, mapper);
|
163 | 166 |
|
|
0 commit comments