jtuglu1 commented on code in PR #18949:
URL: https://github.com/apache/druid/pull/18949#discussion_r2728527544


##########
extensions-contrib/spectator-histogram/src/test/java/org/apache/druid/spectator/histogram/sql/SpectatorHistogramSqlAggregatorTest.java:
##########
@@ -551,4 +553,33 @@ public void testSpectatorFunctionsOnNullHistogram()
         ImmutableList.of(new Object[]{null, null, null})
     );
   }
+
+  @Test
+  public void testSpectatorPercentileWithStringLiteral()
+  {
+    // verify invalid queries return 400 (user error)
+    final String query = "SELECT SPECTATOR_PERCENTILE(histogram_metric, 
'99.99') FROM foo";
+
+    try {
+      testQuery(query, ImmutableList.of(), ImmutableList.of());
+      throw new AssertionError("Expected DruidException but query succeeded");
+    }
+    catch (DruidException e) {
+      if (e.getTargetPersona() != DruidException.Persona.USER) {

Review Comment:
   I think it's more idiomatic to use the `org.junit.Assert` class here. 
Something like:
   ```java
   Assert.assertEquals("Expected USER persona", e.getTargetPersona()), 
DruidException.Persona.USER);
   ```



-- 
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