Skip to content

Commit

Permalink
unit test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
l-trotta committed Dec 17, 2024
1 parent ebbf1d8 commit 61d01cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
Expand Down Expand Up @@ -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")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 61d01cc

Please sign in to comment.