MeihanLi commented on code in PR #17177:
URL: https://github.com/apache/pinot/pull/17177#discussion_r2625654823


##########
pinot-broker/src/test/java/org/apache/pinot/broker/api/resources/PinotClientRequestTest.java:
##########
@@ -202,4 +203,45 @@ public void testPinotQueryComparison() throws Exception {
     assertEquals(comparisonAnalysis.size(), 1);
     Assert.assertTrue(comparisonAnalysis.get(0).contains("Mismatch in number 
of rows returned"));
   }
+
+  @Test
+  public void testGetQueryFingerprintSuccess() throws Exception {
+    Request request = mock(Request.class);
+    when(request.getRequestURL()).thenReturn(new StringBuilder());
+
+    // single stage query
+    String requestJson = "{\"sql\": \"SELECT * FROM myTable WHERE id IN (1, 2, 
3)\"}";
+    Response response = _pinotClientRequest.getQueryFingerprint(requestJson, 
request, null);
+
+    assertEquals(response.getStatus(), Response.Status.OK.getStatusCode());
+    QueryFingerprint fingerprint = (QueryFingerprint) response.getEntity();
+    Assert.assertNotNull(fingerprint);
+    Assert.assertNotNull(fingerprint.getQueryHash());
+    Assert.assertNotNull(fingerprint.getFingerprint());
+    Assert.assertEquals(fingerprint.getFingerprint(), "SELECT * FROM `myTable` 
WHERE `id` IN (?)");

Review Comment:
   I added some descriptive messages for each assertion statement, which can 
address your concern. org.assertj.core.api.Assertions is not included as a 
dependency in this module, and I'd rather keep it consistent with the current 
UT behavior.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to