This is an automated email from the ASF dual-hosted git repository. frankvicky pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push: new 21ffc07212f MINOR: migrate MinInSyncReplicasConfigTest to server module (#19727) 21ffc07212f is described below commit 21ffc07212f2e3899cc84123c746083b628f24c0 Author: Bolin Lin <linbolin1...@gmail.com> AuthorDate: Fri May 16 05:18:28 2025 -0400 MINOR: migrate MinInSyncReplicasConfigTest to server module (#19727) Migrate MinInSyncReplicasConfigTest to the server module Reviewers: PoAn Yang <pay...@apache.org>, Yung <yungyung7654...@gmail.com>, TengYao Chi <frankvi...@apache.org>, Ken Huang <s7133...@gmail.com> --- .../unit/kafka/integration/MinIsrConfigTest.scala | 37 ---------------------- .../server/config/MinInSyncReplicasConfigTest.java | 35 ++++++++++++++++++++ 2 files changed, 35 insertions(+), 37 deletions(-) diff --git a/core/src/test/scala/unit/kafka/integration/MinIsrConfigTest.scala b/core/src/test/scala/unit/kafka/integration/MinIsrConfigTest.scala deleted file mode 100644 index f730e35415f..00000000000 --- a/core/src/test/scala/unit/kafka/integration/MinIsrConfigTest.scala +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package kafka.integration - -import java.util.Properties -import scala.collection.Seq - -import kafka.server.KafkaConfig -import kafka.utils.TestUtils -import org.apache.kafka.server.config.ServerLogConfigs -import org.junit.jupiter.api.Test - -class MinIsrConfigTest extends KafkaServerTestHarness { - val overridingProps = new Properties() - overridingProps.put(ServerLogConfigs.MIN_IN_SYNC_REPLICAS_CONFIG, "5") - def generateConfigs: Seq[KafkaConfig] = TestUtils.createBrokerConfigs(1).map(KafkaConfig.fromProps(_, overridingProps)) - - @Test - def testDefaultKafkaConfig(): Unit = { - assert(brokers.head.logManager.initialDefaultConfig.minInSyncReplicas == 5) - } -} diff --git a/server/src/test/java/org/apache/kafka/server/config/MinInSyncReplicasConfigTest.java b/server/src/test/java/org/apache/kafka/server/config/MinInSyncReplicasConfigTest.java new file mode 100644 index 00000000000..34b7f00e66d --- /dev/null +++ b/server/src/test/java/org/apache/kafka/server/config/MinInSyncReplicasConfigTest.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.kafka.server.config; + +import org.apache.kafka.common.config.TopicConfig; +import org.apache.kafka.common.test.ClusterInstance; +import org.apache.kafka.common.test.api.ClusterConfigProperty; +import org.apache.kafka.common.test.api.ClusterTest; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class MinInSyncReplicasConfigTest { + + @ClusterTest(serverProperties = { + @ClusterConfigProperty(key = TopicConfig.MIN_IN_SYNC_REPLICAS_CONFIG, value = "5") + }) + public void testDefaultKafkaConfig(ClusterInstance cluster) { + assertEquals(5, cluster.brokers().get(0).logManager().initialDefaultConfig().minInSyncReplicas); + } +}