ijuma commented on code in PR #18845:
URL: https://github.com/apache/kafka/pull/18845#discussion_r1950212078


##########
metadata/src/test/java/org/apache/kafka/metadata/bootstrap/BootstrapMetadataTest.java:
##########
@@ -126,13 +126,13 @@ public void testFeatureLevelForFeature() {
     static final List<ApiMessageAndVersion> RECORDS_WITH_OLD_METADATA_VERSION 
= Collections.singletonList(
             new ApiMessageAndVersion(new FeatureLevelRecord().
                 setName(FEATURE_NAME).
-                setFeatureLevel(IBP_3_0_IV1.featureLevel()), (short) 0));
+                
setFeatureLevel(MetadataVersionTestUtils.IBP_3_0_IV1_FEATURE_LEVEL), (short) 
0));
 
     @Test
     public void testFromRecordsListWithOldMetadataVersion() {
         RuntimeException exception = assertThrows(RuntimeException.class,
             () -> 
BootstrapMetadata.fromRecords(RECORDS_WITH_OLD_METADATA_VERSION, "quux"));
-        assertEquals("Bootstrap metadata.version before 3.3-IV0 are not 
supported. Can't load " +
-            "metadata from quux", exception.getMessage());
+        assertEquals("No MetadataVersion with feature level 1. Valid feature 
levels are from 7 to 25.",

Review Comment:
   It's a good question and I wondered the same. One challenge is that the test 
ends up pretty similar to the actual code. But I don't feel strongly. Perhaps a 
middle ground is to use the constant for the latest version - which changes 
frequently. The minimum version changes very infrequently and it's probably 
good to find out if we accidentally change it. Thoughts?



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

Reply via email to