gus-asf commented on code in PR #4080:
URL: https://github.com/apache/solr/pull/4080#discussion_r2776514079


##########
solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java:
##########
@@ -114,26 +114,27 @@ public void testIntrospect() throws Exception {
   }
 
   @Test
-  public void testWTParam() throws Exception {
+  public void testInvalidWTParamReturnsError() throws Exception {
     V2Request request = new V2Request.Builder("/c/" + COLL_NAME + 
"/get/_introspect").build();
-    // TODO: If possible do this in a better way
+    // Using an invalid wt parameter should return a 500 error
     request.setResponseParser(new InputStreamResponseParser("bleh"));
     NamedList<Object> res = cluster.getSolrClient().request(request);
     String respString = InputStreamResponseParser.consumeResponseToString(res);
 
-    assertFalse(respString.contains("<body><h2>HTTP ERROR 500</h2>"));
-    assertFalse(respString.contains("500"));
-    assertFalse(respString.contains("NullPointerException"));
-    assertFalse(
-        respString.contains(
-            "<p>Problem accessing /solr/____v2/c/collection1/get/_introspect. 
Reason:"));
-    // since no-op response writer is used, doing contains match
-    assertTrue(respString.contains("/c/collection1/get"));
+    // Should get a 500 Server Error for unknown writer type
+    assertTrue(
+        "Expected error message about unknown writer type",
+        respString.contains("Unknown response writer type"));
+    assertTrue("Expected 500 error code", respString.contains("500"));

Review Comment:
   -1 The server is not broken. This should be 400



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