jim0987795064 commented on code in PR #20399:
URL: https://github.com/apache/kafka/pull/20399#discussion_r2349953748


##########
core/src/test/scala/unit/kafka/server/AbstractFetcherManagerTest.scala:
##########
@@ -355,4 +356,22 @@ class AbstractFetcherManagerTest {
     override protected def endOffsetForEpoch(topicPartition: TopicPartition, 
epoch: Int): Optional[OffsetAndEpoch] = Optional.of(new OffsetAndEpoch(1, 0))
   }
 
+  @Test
+  def testMetricsClassName(): Unit = {
+    val config = mock(classOf[KafkaConfig])
+    val replicaManager = mock(classOf[ReplicaManager])
+    val quotaManager = mock(classOf[ReplicationQuotaManager])
+    val brokerTopicStats   = new BrokerTopicStats()
+    val directoryEventHandler = DirectoryEventHandler.NOOP
+    val metrics = new Metrics()
+    val time = new MockTime()
+    val metadataVersionSupplier = () => MetadataVersion.LATEST_PRODUCTION
+    val brokerEpochSupplier = () => 1L
+
+    val replicaAlterLogDirsManager = new ReplicaAlterLogDirsManager(config, 
replicaManager, quotaManager, brokerTopicStats, directoryEventHandler)
+    val replicaFetcherManager = new ReplicaFetcherManager(config, 
replicaManager, metrics, time, quotaManager, metadataVersionSupplier, 
brokerEpochSupplier)
+
+    assertEquals("ReplicaAlterLogDirsManager", 
replicaAlterLogDirsManager.getMetricsClassName)
+    assertEquals("ReplicaFetcherManager", 
replicaFetcherManager.getMetricsClassName)

Review Comment:
   @kuoche1712003 Thanks for your suggestion. I’ve used this API to verify the 
correctness of MetricsClassName.



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