ijuma commented on code in PR #18414: URL: https://github.com/apache/kafka/pull/18414#discussion_r1917650372
########## core/src/test/scala/unit/kafka/KafkaConfigTest.scala: ########## @@ -41,6 +41,23 @@ class KafkaConfigTest { @AfterEach def tearDown(): Unit = Exit.resetExitProcedure() + @Test + def testRequiredProperties(): Unit = { + // process.roles + val properties = new Properties() + assertBadConfigContainingMessage(properties, + "Missing required configuration \"process.roles\" which has no default value.") + + // node.id Review Comment: I think this comment is not too helpful - either we must provide more context or just delete it (the error message below makes it clear which config is missing). ########## core/src/test/scala/unit/kafka/KafkaConfigTest.scala: ########## @@ -41,6 +41,23 @@ class KafkaConfigTest { @AfterEach def tearDown(): Unit = Exit.resetExitProcedure() + @Test + def testRequiredProperties(): Unit = { + // process.roles + val properties = new Properties() + assertBadConfigContainingMessage(properties, + "Missing required configuration \"process.roles\" which has no default value.") + + // node.id + properties.put(KRaftConfigs.PROCESS_ROLES_CONFIG, "controller") + assertBadConfigContainingMessage(properties, + "Missing required configuration \"node.id\" which has no default value.") + + properties.put(KRaftConfigs.NODE_ID_CONFIG, -1) + assertBadConfigContainingMessage(properties, + "Invalid value -1 for configuration node.id: Value must be at least 0") Review Comment: Can we add the case where it works to make sure we don't have any other required configs? -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org