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


##########
core/src/test/scala/unit/kafka/network/ProcessorTest.scala:
##########
@@ -65,13 +65,31 @@ class ProcessorTest {
   @Test
   def testParseRequestHeaderWithUnsupportedApiVersion(): Unit = {
     val requestHeader = RequestTestUtils.serializeRequestHeader(
-      new RequestHeader(ApiKeys.PRODUCE, 0, "clientid", 0))
+      new RequestHeader(ApiKeys.FETCH, 0, "clientid", 0))
     val apiVersionManager = new SimpleApiVersionManager(ListenerType.BROKER, 
true,
       () => new FinalizedFeatures(MetadataVersion.latestTesting(), 
Collections.emptyMap[String, java.lang.Short], 0))
     val e = assertThrows(classOf[UnsupportedVersionException],
       (() => Processor.parseRequestHeader(apiVersionManager, requestHeader)): 
Executable,
-      "PRODUCE v0 should throw UnsupportedVersionException exception")
+      "FETCH v0 should throw UnsupportedVersionException exception")
     assertTrue(e.toString.contains("unsupported version"));
   }
 
+  /**
+   * We do something unusual with these versions of produce, and we want to 
make sure we don't regress.
+   * See `ApiKeys.PRODUCE_API_VERSIONS_RESPONSE_MIN_VERSION` for details.
+   */
+  @Test
+  def testParseRequestHeaderForProduceV0ToV2(): Unit = {
+    for (version <- 0 to 2) {
+      val requestHeader = RequestTestUtils.serializeRequestHeader(
+        new RequestHeader(ApiKeys.PRODUCE, version.toShort, "clientid", 0))
+      val apiVersionManager = new SimpleApiVersionManager(ListenerType.BROKER, 
true,

Review Comment:
   Fixed.



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