From 61d01ccb7a83bdaed6b237e24f26cecfbf8a411e Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Tue, 17 Dec 2024 12:24:27 +0100 Subject: [PATCH] unit test fixes --- .../_helpers/esql/EsqlAdapterEndToEndTest.java | 12 ++++++++++-- .../elasticsearch/spec_issues/SpecIssuesTest.java | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/java-client/src/test/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlAdapterEndToEndTest.java b/java-client/src/test/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlAdapterEndToEndTest.java index 3cfd884bf..eaa413e2b 100644 --- a/java-client/src/test/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlAdapterEndToEndTest.java +++ b/java-client/src/test/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlAdapterEndToEndTest.java @@ -134,7 +134,11 @@ public void objectsTest() throws Exception { { EmpData emp = it.next(); assertEquals("10042", emp.empNo); - assertEquals(Arrays.asList("Architect", "Business Analyst", "Internship", "Junior Developer"), emp.jobPositions); + assertEquals(4, emp.jobPositions.size()); + assertTrue(emp.jobPositions.contains("Architect")); + assertTrue(emp.jobPositions.contains("Business Analyst")); + assertTrue(emp.jobPositions.contains("Internship")); + assertTrue(emp.jobPositions.contains("Junior Developer")); assertEquals("1993-03-21T00:00:00Z[UTC]", DateTimeFormatter.ISO_DATE_TIME.format(emp.hireDate.toInstant().atZone(ZoneId.of("UTC"))) @@ -172,7 +176,11 @@ public void asyncObjects() throws Exception { { EmpData emp = it.next(); assertEquals("10042", emp.empNo); - assertEquals(Arrays.asList("Architect", "Business Analyst", "Internship", "Junior Developer"), emp.jobPositions); + assertEquals(4, emp.jobPositions.size()); + assertTrue(emp.jobPositions.contains("Architect")); + assertTrue(emp.jobPositions.contains("Business Analyst")); + assertTrue(emp.jobPositions.contains("Internship")); + assertTrue(emp.jobPositions.contains("Junior Developer")); assertEquals("1993-03-21T00:00:00Z[UTC]", DateTimeFormatter.ISO_DATE_TIME.format(emp.hireDate.toInstant().atZone(ZoneId.of("UTC"))) diff --git a/java-client/src/test/java/co/elastic/clients/elasticsearch/spec_issues/SpecIssuesTest.java b/java-client/src/test/java/co/elastic/clients/elasticsearch/spec_issues/SpecIssuesTest.java index f1bd2857b..72a49504f 100644 --- a/java-client/src/test/java/co/elastic/clients/elasticsearch/spec_issues/SpecIssuesTest.java +++ b/java-client/src/test/java/co/elastic/clients/elasticsearch/spec_issues/SpecIssuesTest.java @@ -115,12 +115,12 @@ public void i0297_mappingSettings() { .index("i0297") .settings(s -> s // This is "mapping" and not "mappings" - .mapping(m -> m.totalFields(totalFields -> totalFields.limit(1001L))) + .mapping(m -> m.totalFields(totalFields -> totalFields.limit("1001"))) .otherSettings("foo", JsonData.of("bar")) ) ); - assertEquals("{\"settings\":{\"foo\":\"bar\",\"mapping\":{\"total_fields\":{\"limit\":1001}}}}", toJson(request)); + assertEquals("{\"settings\":{\"foo\":\"bar\",\"mapping\":{\"total_fields\":{\"limit\":\"1001\"}}}}", toJson(request)); } @Test