dsmiley commented on code in PR #3197:
URL: https://github.com/apache/solr/pull/3197#discussion_r1969829463


##########
solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java:
##########
@@ -1027,6 +1028,64 @@ public static String assertJQ(SolrQueryRequest req, 
double delta, String... test
     }
   }
 
+  public static <T> String assertThatJQ(SolrQueryRequest req, Matcher<T> test) 
throws Exception {
+    return assertThatJQ(req, "", test);
+  }
+
+  /**
+   * Validates a query completes and, using JSON deserialization, returns an 
object that passes the
+   * given Matcher test.
+   *
+   * <p>Please use this with care: this makes it easy to match complete 
structures, but doing so can
+   * result in fragile tests if you are matching more than what you want to 
test.
+   *
+   * @param req Solr request to execute
+   * @param message Failure message for test
+   * @param test Matcher for the given object returned from deserializing the 
response
+   * @return The request response as a JSON String if the test matcher passes
+   */
+  @SuppressWarnings("unchecked")
+  public static <T> String assertThatJQ(SolrQueryRequest req, String message, 
Matcher<T> test)

Review Comment:
   That's fair



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