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


##########
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:
   I thought about this, but the entire test is set up to use the test harness, 
so I wanted to implement this test to fit in with the surrounding tests as best 
as possible. 
   
   Adding one more convenience method to the test harness to fit the existing 
workflow I think is pretty minor compared to starting a whole new way for this 
test to behave. Deprecating the TestHarness (and actually removing it) is going 
to be a MAJOR ordeal, and honestly IMO changing a test to 1/2 use the test 
harness and 1/2 use something else will probably make that harder in the end.



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to