bszabo97 commented on code in PR #1682:
URL: https://github.com/apache/solr/pull/1682#discussion_r1221693104


##########
solr/core/src/test/org/apache/solr/handler/admin/api/GetSchemaAPITest.java:
##########
@@ -55,6 +59,38 @@ public void testReliesOnIndexSchemaWhenFetchingWholeSchema() 
{
     assertEquals("flagValue", response.schema.get("flagKey"));
   }
 
+  @Test
+  public void testLooksUpNameFromLatestCoreSchema() throws Exception {
+    when(mockSchema.getSchemaName()).thenReturn("expectedSchemaName");
+
+    final GetSchemaAPI.SchemaNameResponse response = api.getSchemaName();
+
+    assertEquals("expectedSchemaName", response.name);
+    assertNull(response.error);
+  }
+
+  /**
+   * Test the v2 to v1 response mapping for /schema/name
+   *
+   * <p>{@link SchemaHandler} uses the v2 {@link GetSchemaAPI} (and its 
response class {@link
+   * GetSchemaAPI.SchemaNameResponse}) internally to serve the v1 version of 
this functionality. So
+   * it's important to make sure that our response stays compatible with SolrJ 
- both because that's
+   * important in its own right and because that ensures we haven't 
accidentally changed the v1
+   * response format.
+   */
+  @Test
+  public void testResponseCanBeParsedBySolrJ() {

Review Comment:
   It was your idea, I just copied this test from the already existing one :D I 
can add similar tests to more places if you think it would be useful.



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