This is an automated email from the ASF dual-hosted git repository.

suneet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 5edeac28df5 + Switching Comparison from String to JSON (#15364)
5edeac28df5 is described below

commit 5edeac28df5bba67b28ed15ca26c9c6c89b5b3f7
Author: Krishna Anandan <[email protected]>
AuthorDate: Tue Nov 14 10:07:19 2023 -0600

    + Switching Comparison from String to JSON (#15364)
---
 .../histogram/ApproximateHistogramAggregatorTest.java         | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git 
a/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregatorTest.java
 
b/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregatorTest.java
index e1a1b6c6b86..cc7d876f9f3 100644
--- 
a/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregatorTest.java
+++ 
b/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregatorTest.java
@@ -19,6 +19,7 @@
 
 package org.apache.druid.query.aggregation.histogram;
 
+import com.fasterxml.jackson.databind.JsonNode;
 import org.apache.druid.jackson.DefaultObjectMapper;
 import org.apache.druid.java.util.common.granularity.Granularities;
 import org.apache.druid.query.Druids;
@@ -106,14 +107,12 @@ public class ApproximateHistogramAggregatorTest extends 
InitializedNullHandlingT
 
     ApproximateHistogramAggregator agg = new 
ApproximateHistogramAggregator(selector, resolution, 0, 100);
     agg.aggregate();
-
     Object finalizedObjectHumanReadable = 
humanReadableFactory.finalizeComputation(agg.get());
     String finalStringHumanReadable = 
objectMapper.writeValueAsString(finalizedObjectHumanReadable);
-    Assert.assertEquals(
-        
"{\"breaks\":[23.0,23.0,23.0,23.0,23.0,23.0],\"counts\":[0.0,0.0,0.0,0.0,0.0]}",
-        finalStringHumanReadable
-    );
-
+    JsonNode expectedJson = objectMapper.readTree(
+            
"{\"breaks\":[23.0,23.0,23.0,23.0,23.0,23.0],\"counts\":[0.0,0.0,0.0,0.0,0.0]}");
+    JsonNode actualJson = objectMapper.readTree(finalStringHumanReadable);
+    Assert.assertEquals(expectedJson, actualJson);
     Object finalizedObjectBinary = 
binaryFactory.finalizeComputation(agg.get());
     String finalStringBinary = 
objectMapper.writeValueAsString(finalizedObjectBinary);
     Assert.assertEquals(


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to