Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
swallez committed Apr 29, 2022
1 parent fb5d5f2 commit 66da097
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class LoadingJsonTest extends ModelTestCase {
private final DocTestsTransport transport = new DocTestsTransport();
private final ElasticsearchClient client = new ElasticsearchClient(transport);

private static final SearchResponse<JsonData> searchResponse = SearchResponse.searchResponseOf(b -> b
private static final SearchResponse<JsonData> searchResponse = SearchResponse.of(b -> b
.aggregations(new HashMap<>())
.took(0)
.timedOut(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class AggregationsTest extends ModelTestCase {

private final Logger logger = LoggerFactory.getLogger(this.getClass());

private static final SearchResponse<JsonData> searchResponse = SearchResponse.searchResponseOf(b -> b
private static final SearchResponse<JsonData> searchResponse = SearchResponse.of(b -> b
.aggregations(new HashMap<>())
.took(0)
.timedOut(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class SearchingTest {

private final Logger logger = LoggerFactory.getLogger(this.getClass());

private static final SearchResponse<JsonData> searchResponse = SearchResponse.searchResponseOf(b -> b
private static final SearchResponse<JsonData> searchResponse = SearchResponse.of(b -> b
.aggregations(new HashMap<>())
.took(0)
.timedOut(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void testObjectAndArrayPath() {

JsonpMappingException e = assertThrows(JsonpMappingException.class, () -> {
// withJson() will read values of the generic parameter type as JsonData
SearchResponse<JsonData> r = SearchResponse.searchResponseOf(b -> b
SearchResponse<JsonData> r = SearchResponse.of(b -> b
.withJson(new StringReader(json))
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@ public void testRequestWithGenericValueBody() {
@Test
public void testRequestWithValueBody() {
String json = "{" +
"\"analyze.max_token_count\": 12" +
"\"analyze\": {" +
" \"max_token_count\": 12" +
" }" +
"}";

PutIndicesSettingsRequest req = PutIndicesSettingsRequest.of(b -> b
.withJson(new StringReader(json))
);

assertEquals(12, req.settings().analyzeMaxTokenCount().intValue());
assertEquals(12, req.settings().analyze().maxTokenCount().intValue());
}

@Test
Expand Down Expand Up @@ -108,7 +110,7 @@ public void testObjectWithGenericParam() {
"}";

// withJson() will read values of the generic parameter type as JsonData
SearchResponse<JsonData> r = SearchResponse.searchResponseOf(b -> b
SearchResponse<JsonData> r = SearchResponse.of(b -> b
.withJson(new StringReader(json))
);

Expand Down

0 comments on commit 66da097

Please sign in to comment.