yashmayya commented on code in PR #16070: URL: https://github.com/apache/pinot/pull/16070#discussion_r2139658718
########## pinot-controller/src/test/java/org/apache/pinot/controller/api/PinotTableRestletResourceTest.java: ########## @@ -960,6 +960,32 @@ public void testTableWithSameNameAsLogicalTableIsNotAllowed() aThrows.getMessage()); } + @Test + public void testGetNonExistentTableConfig() { + // Attempt to get a non-existent table config + String tableName = "nonExistentTable"; + String url = DEFAULT_INSTANCE.getControllerRequestURLBuilder().forTableGet(tableName); + String msg = expectThrows(IOException.class, () -> sendGetRequest(url)).getMessage(); + assertTrue( + msg.contains("Got error status code: 404 (Not Found) with reason: \"Table nonExistentTable does not exist\""), + msg); + Review Comment: See https://github.com/apache/pinot/blob/e18845e4b93bfaa0548052846369b5b323dc5514/pinot-controller/src/test/java/org/apache/pinot/controller/helix/ControllerTest.java#L1045 for instance. ########## pinot-controller/src/test/java/org/apache/pinot/controller/api/PinotTableRestletResourceTest.java: ########## @@ -960,6 +960,32 @@ public void testTableWithSameNameAsLogicalTableIsNotAllowed() aThrows.getMessage()); } + @Test + public void testGetNonExistentTableConfig() { + // Attempt to get a non-existent table config + String tableName = "nonExistentTable"; + String url = DEFAULT_INSTANCE.getControllerRequestURLBuilder().forTableGet(tableName); + String msg = expectThrows(IOException.class, () -> sendGetRequest(url)).getMessage(); + assertTrue( + msg.contains("Got error status code: 404 (Not Found) with reason: \"Table nonExistentTable does not exist\""), + msg); + Review Comment: nit: Could we add a variant of `sendGetRequest` that also returns a status code and makes an assertion on that instead? -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org