gaurav-narula commented on code in PR #22384:
URL: https://github.com/apache/kafka/pull/22384#discussion_r3324292695
##########
metadata/src/test/java/org/apache/kafka/metadata/storage/FormatterTest.java:
##########
@@ -587,4 +587,18 @@ public void testFormatWithNoInitialControllers() throws
Exception {
assertNotNull(logDirProps1);
}
}
+
+ @ParameterizedTest
+ @ValueSource(strings = {"unrvTtQISjar0JUWGU/8Pg",
"igNUVIdeSPO5JCZYFhOh7Q==", "AAAAAAAAAAAAAAAAAAAAAA", "AAAAAAAAAAAAAAAAAAAAAQ"})
+ public void testFormatWithInvalidClusterId(String clusterId) throws
Exception {
+ try (TestEnv testEnv = new TestEnv(2)) {
+ FormatterContext formatter1 = testEnv.newFormatter();
+ formatter1.formatter.setClusterId(clusterId);
+ String expectedPrefix = "The specified cluster id, " + clusterId;
+ assertEquals(expectedPrefix,
+ assertThrows(FormatterException.class,
+ formatter1.formatter::run).
+ getMessage().substring(0,
expectedPrefix.length()));
Review Comment:
I'm indifferent here - I followed the convention used in another test in the
same class
--
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]