Jackie-Jiang commented on a change in pull request #3993: In TableConfig, add
checks for mandatory fields
URL: https://github.com/apache/incubator-pinot/pull/3993#discussion_r267584320
##########
File path:
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/OfflineClusterIntegrationTest.java
##########
@@ -150,6 +152,22 @@ public void testInstancesStarted() {
}
}
+ @Test
+ public void testInvalidTableConfig() {
+ TableConfig tableConfig =
+ new
TableConfig.Builder(CommonConstants.Helix.TableType.OFFLINE).setTableName("badTable").build();
+ ObjectNode jsonConfig = tableConfig.toJsonConfig();
+ // Remove a mandatory field
+ jsonConfig.remove(TableConfig.VALIDATION_CONFIG_KEY);
+ try {
+ sendPostRequest(_controllerRequestURLBuilder.forTableCreate(),
jsonConfig.toString());
+ fail();
+ } catch (IOException e) {
+ // Should get response code 400 (BAD_REQUEST)
+ assertTrue(e.getMessage().startsWith("Server returned HTTP response
code: 400"));
Review comment:
I understand your concern, but on this level we don't have access to the
message. I added checks on the message in the unit test.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]