Skip to content

Commit e2c8bb2

Browse files
committed
update tests
1 parent de9f4ae commit e2c8bb2

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

java-client/src/test/java/co/elastic/clients/documentation/LoadingJsonTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class LoadingJsonTest extends ModelTestCase {
4848
private DocTestsTransport transport = new DocTestsTransport();
4949
private ElasticsearchClient client = new ElasticsearchClient(transport);
5050

51-
private static SearchResponse<JsonData> searchResponse = SearchResponse.searchResponseOf(b -> b
51+
private static SearchResponse<JsonData> searchResponse = SearchResponse.of(b -> b
5252
.aggregations(new HashMap<>())
5353
.took(0)
5454
.timedOut(false)

java-client/src/test/java/co/elastic/clients/elasticsearch/ElasticsearchTestServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private synchronized void setup() {
6060
container = new ElasticsearchContainer("docker.elastic.co/elasticsearch/elasticsearch:7.16.2")
6161
.withEnv("ES_JAVA_OPTS", "-Xms256m -Xmx256m")
6262
.withEnv("path.repo", "/tmp") // for snapshots
63-
.withStartupTimeout(Duration.ofSeconds(30))
63+
.withStartupTimeout(Duration.ofSeconds(120))
6464
.withPassword("changeme");
6565
container.start();
6666
port = container.getMappedPort(9200);

java-client/src/test/java/co/elastic/clients/json/JsonpMappingExceptionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void testObjectAndArrayPath() {
6969

7070
JsonpMappingException e = assertThrows(JsonpMappingException.class, () -> {
7171
// withJson() will read values of the generic parameter type as JsonData
72-
SearchResponse<JsonData> r = SearchResponse.searchResponseOf(b -> b
72+
SearchResponse<JsonData> r = SearchResponse.of(b -> b
7373
.withJson(new StringReader(json))
7474
);
7575
});

java-client/src/test/java/co/elastic/clients/json/WithJsonTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,16 @@ public void testRequestWithGenericValueBody() {
5252
@Test
5353
public void testRequestWithValueBody() {
5454
String json = "{" +
55-
"\"analyze.max_token_count\": 12" +
55+
"\"analyze\": {" +
56+
" \"max_token_count\": 12" +
57+
" }" +
5658
"}";
5759

5860
PutIndicesSettingsRequest req = PutIndicesSettingsRequest.of(b -> b
5961
.withJson(new StringReader(json))
6062
);
6163

62-
assertEquals(12, req.settings().analyzeMaxTokenCount().intValue());
64+
assertEquals(12, req.settings().analyze().maxTokenCount().intValue());
6365
}
6466

6567
@Test
@@ -108,7 +110,7 @@ public void testObjectWithGenericParam() {
108110
"}";
109111

110112
// withJson() will read values of the generic parameter type as JsonData
111-
SearchResponse<JsonData> r = SearchResponse.searchResponseOf(b -> b
113+
SearchResponse<JsonData> r = SearchResponse.of(b -> b
112114
.withJson(new StringReader(json))
113115
);
114116

0 commit comments

Comments
 (0)