diff --git a/.github/workflows/check-build-test.yml b/.github/workflows/check-build-test.yml index 1a6b1bf73..3a2ba0d13 100644 --- a/.github/workflows/check-build-test.yml +++ b/.github/workflows/check-build-test.yml @@ -124,9 +124,9 @@ jobs: fail-fast: false matrix: include: - - { scalaVersion: '2.13', java-version: 'temurin:1.11', sbt-opts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' } - - { scalaVersion: '2.13', java-version: 'temurin:1.21', sbt-opts: '' } - - { scalaVersion: '3.3', java-version: 'temurin:1.21', sbt-opts: '' } + - { name: "Scala 2.13, JDK 11", scalaVersion: '2.13', java-version: 'temurin:1.11', sbt-opts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' } + - { name: "Scala 2.13, JDK 21", scalaVersion: '2.13', java-version: 'temurin:1.21', sbt-opts: '' } + - { name: "Scala 3.3, JDK 21", scalaVersion: '3.3', java-version: 'temurin:1.21', sbt-opts: '' } steps: - name: Checkout # https://github.com/actions/checkout/releases diff --git a/benchmarks/src/main/scala/akka/kafka/benchmarks/InflightMetrics.scala b/benchmarks/src/main/scala/akka/kafka/benchmarks/InflightMetrics.scala index e570ae3c4..b8d9160d8 100644 --- a/benchmarks/src/main/scala/akka/kafka/benchmarks/InflightMetrics.scala +++ b/benchmarks/src/main/scala/akka/kafka/benchmarks/InflightMetrics.scala @@ -18,7 +18,7 @@ import javax.management.{Attribute, MBeanServerConnection, ObjectName} import scala.concurrent.duration.{FiniteDuration, _} import scala.concurrent.{ExecutionContext, Future} -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ private[benchmarks] trait InflightMetrics { import InflightMetrics._ diff --git a/benchmarks/src/main/scala/akka/kafka/benchmarks/KafkaConsumerBenchmarks.scala b/benchmarks/src/main/scala/akka/kafka/benchmarks/KafkaConsumerBenchmarks.scala index 5b77c78c5..4c96c6ab7 100644 --- a/benchmarks/src/main/scala/akka/kafka/benchmarks/KafkaConsumerBenchmarks.scala +++ b/benchmarks/src/main/scala/akka/kafka/benchmarks/KafkaConsumerBenchmarks.scala @@ -14,7 +14,7 @@ import org.apache.kafka.clients.consumer.{OffsetAndMetadata, OffsetCommitCallbac import org.apache.kafka.common.TopicPartition import scala.annotation.tailrec -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ object KafkaConsumerBenchmarks extends LazyLogging { val pollTimeoutMs: Duration = Duration.ofMillis(50L) diff --git a/benchmarks/src/main/scala/akka/kafka/benchmarks/KafkaConsumerFixtureGen.scala b/benchmarks/src/main/scala/akka/kafka/benchmarks/KafkaConsumerFixtureGen.scala index 720c1774d..c5f5a3cdb 100644 --- a/benchmarks/src/main/scala/akka/kafka/benchmarks/KafkaConsumerFixtureGen.scala +++ b/benchmarks/src/main/scala/akka/kafka/benchmarks/KafkaConsumerFixtureGen.scala @@ -9,7 +9,7 @@ import akka.kafka.benchmarks.app.RunTestCommand import org.apache.kafka.clients.consumer.{ConsumerConfig, KafkaConsumer} import org.apache.kafka.common.serialization.{ByteArrayDeserializer, StringDeserializer} -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ case class KafkaConsumerTestFixture(topic: String, msgCount: Int, consumer: KafkaConsumer[Array[Byte], String]) { def close(): Unit = consumer.close() diff --git a/benchmarks/src/main/scala/akka/kafka/benchmarks/KafkaTransactionBenchmarks.scala b/benchmarks/src/main/scala/akka/kafka/benchmarks/KafkaTransactionBenchmarks.scala index 6c8189d7d..4f5d0c0c7 100644 --- a/benchmarks/src/main/scala/akka/kafka/benchmarks/KafkaTransactionBenchmarks.scala +++ b/benchmarks/src/main/scala/akka/kafka/benchmarks/KafkaTransactionBenchmarks.scala @@ -13,7 +13,7 @@ import org.apache.kafka.clients.producer.{Callback, ProducerRecord, RecordMetada import org.apache.kafka.common.TopicPartition import scala.annotation.tailrec -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.concurrent.duration.FiniteDuration object KafkaTransactionBenchmarks extends LazyLogging { diff --git a/benchmarks/src/main/scala/akka/kafka/benchmarks/KafkaTransactionFixtureGen.scala b/benchmarks/src/main/scala/akka/kafka/benchmarks/KafkaTransactionFixtureGen.scala index 069c46202..be45e65ad 100644 --- a/benchmarks/src/main/scala/akka/kafka/benchmarks/KafkaTransactionFixtureGen.scala +++ b/benchmarks/src/main/scala/akka/kafka/benchmarks/KafkaTransactionFixtureGen.scala @@ -18,7 +18,7 @@ import org.apache.kafka.common.serialization.{ StringSerializer } -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ case class KafkaTransactionTestFixture(sourceTopic: String, sinkTopic: String, diff --git a/build.sbt b/build.sbt index 2e4348cd7..2eb80f33d 100644 --- a/build.sbt +++ b/build.sbt @@ -106,8 +106,7 @@ val commonSettings = Def.settings( "-encoding", "UTF-8", // yes, this is 2 args "-release", - "11", - "-Wconf:cat=feature:w,cat=deprecation&msg=.*JavaConverters.*:s,cat=unchecked:w,cat=lint:w,cat=unused:w,cat=w-flag:w" + "11" ) ++ { if (scalaVersion.value != Scala3) Seq("-Werror") else Seq.empty @@ -170,9 +169,9 @@ lazy val `alpakka-kafka` = .disablePlugins(SitePlugin, MimaPlugin, CiReleasePlugin) .settings(commonSettings) .settings( + crossScalaVersions := Nil, publish / skip := true, - // TODO: add clusterSharding to unidocProjectFilter when we drop support for Akka 2.5 - ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(core, testkit), + ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(core, testkit, clusterSharding), onLoadMessage := """ |** Welcome to the Alpakka Kafka connector! ** @@ -405,10 +404,3 @@ lazy val benchmarks = project "org.scalatest" %% "scalatest" % scalatestVersion % IntegrationTest ) ) - -val isJdk11orHigher: Boolean = { - val result = VersionNumber(sys.props("java.specification.version")).matchesSemVer(SemanticSelector(">=11")) - if (!result) - throw new IllegalArgumentException("JDK 11 or higher is required") - result -} diff --git a/core/src/main/scala/akka/kafka/ConsumerMessage.scala b/core/src/main/scala/akka/kafka/ConsumerMessage.scala index 7b6569ad0..be50adb3b 100644 --- a/core/src/main/scala/akka/kafka/ConsumerMessage.scala +++ b/core/src/main/scala/akka/kafka/ConsumerMessage.scala @@ -180,7 +180,7 @@ object ConsumerMessage { * Create an offset batch out of a list of offsets. */ def createCommittableOffsetBatch[T <: Committable](offsets: java.util.List[T]): CommittableOffsetBatch = { - import scala.collection.JavaConverters._ + import scala.jdk.CollectionConverters._ CommittableOffsetBatch(offsets.asScala.toList) } diff --git a/core/src/main/scala/akka/kafka/ConsumerSettings.scala b/core/src/main/scala/akka/kafka/ConsumerSettings.scala index 511b85749..8db170de4 100644 --- a/core/src/main/scala/akka/kafka/ConsumerSettings.scala +++ b/core/src/main/scala/akka/kafka/ConsumerSettings.scala @@ -15,7 +15,7 @@ import com.typesafe.config.Config import org.apache.kafka.clients.consumer.{Consumer, ConsumerConfig, KafkaConsumer} import org.apache.kafka.common.serialization.Deserializer -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.compat.java8.OptionConverters._ import scala.compat.java8.FutureConverters._ import scala.concurrent.{ExecutionContext, Future} diff --git a/core/src/main/scala/akka/kafka/Metadata.scala b/core/src/main/scala/akka/kafka/Metadata.scala index b080cc1de..44ed8020b 100644 --- a/core/src/main/scala/akka/kafka/Metadata.scala +++ b/core/src/main/scala/akka/kafka/Metadata.scala @@ -11,7 +11,7 @@ import akka.actor.NoSerializationVerificationNeeded import org.apache.kafka.clients.consumer.{OffsetAndMetadata, OffsetAndTimestamp} import org.apache.kafka.common.{PartitionInfo, TopicPartition} -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.util.Try /** diff --git a/core/src/main/scala/akka/kafka/ProducerMessage.scala b/core/src/main/scala/akka/kafka/ProducerMessage.scala index 2b44887cc..dafbf89e5 100644 --- a/core/src/main/scala/akka/kafka/ProducerMessage.scala +++ b/core/src/main/scala/akka/kafka/ProducerMessage.scala @@ -9,7 +9,7 @@ import akka.NotUsed import org.apache.kafka.clients.producer.{ProducerRecord, RecordMetadata} import scala.collection.immutable -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ /** * Classes that are used in both [[javadsl.Producer]] and diff --git a/core/src/main/scala/akka/kafka/ProducerSettings.scala b/core/src/main/scala/akka/kafka/ProducerSettings.scala index f3da07516..0be9037e0 100644 --- a/core/src/main/scala/akka/kafka/ProducerSettings.scala +++ b/core/src/main/scala/akka/kafka/ProducerSettings.scala @@ -14,7 +14,7 @@ import com.typesafe.config.Config import org.apache.kafka.clients.producer.{KafkaProducer, Producer, ProducerConfig} import org.apache.kafka.common.serialization.Serializer -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.compat.java8.OptionConverters._ import scala.concurrent.duration._ import akka.util.JavaDurationConverters._ diff --git a/core/src/main/scala/akka/kafka/Subscriptions.scala b/core/src/main/scala/akka/kafka/Subscriptions.scala index 3f8c91f45..e473d0348 100644 --- a/core/src/main/scala/akka/kafka/Subscriptions.scala +++ b/core/src/main/scala/akka/kafka/Subscriptions.scala @@ -12,7 +12,7 @@ import akka.kafka.internal.PartitionAssignmentHelpers.EmptyPartitionAssignmentHa import org.apache.kafka.common.TopicPartition import scala.annotation.varargs -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ sealed trait Subscription { diff --git a/core/src/main/scala/akka/kafka/internal/ConfigSettings.scala b/core/src/main/scala/akka/kafka/internal/ConfigSettings.scala index 2b3053d2d..cb4bdd9ef 100644 --- a/core/src/main/scala/akka/kafka/internal/ConfigSettings.scala +++ b/core/src/main/scala/akka/kafka/internal/ConfigSettings.scala @@ -11,7 +11,7 @@ import akka.annotation.InternalApi import com.typesafe.config.{Config, ConfigObject} import scala.annotation.tailrec -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.concurrent.duration.Duration import akka.util.JavaDurationConverters._ diff --git a/core/src/main/scala/akka/kafka/internal/ConsumerProgressTracking.scala b/core/src/main/scala/akka/kafka/internal/ConsumerProgressTracking.scala index ef621c1ca..3995a9004 100644 --- a/core/src/main/scala/akka/kafka/internal/ConsumerProgressTracking.scala +++ b/core/src/main/scala/akka/kafka/internal/ConsumerProgressTracking.scala @@ -8,7 +8,7 @@ import akka.annotation.InternalApi import org.apache.kafka.clients.consumer.{Consumer, ConsumerRecords, OffsetAndMetadata} import org.apache.kafka.common.TopicPartition -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ /** * Maintain our own OffsetAndTimestamp which can tolerate negative timestamps, which happen for old clients that diff --git a/core/src/main/scala/akka/kafka/internal/ConsumerResetProtection.scala b/core/src/main/scala/akka/kafka/internal/ConsumerResetProtection.scala index 13efbf705..acab5a73e 100644 --- a/core/src/main/scala/akka/kafka/internal/ConsumerResetProtection.scala +++ b/core/src/main/scala/akka/kafka/internal/ConsumerResetProtection.scala @@ -15,7 +15,7 @@ import akka.kafka.internal.KafkaConsumerActor.Internal.Seek import org.apache.kafka.clients.consumer.{ConsumerRecord, ConsumerRecords, OffsetAndMetadata} import org.apache.kafka.common.TopicPartition -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ /** * Added as part of https://github.com/akka/alpakka-kafka/issues/1286 to avoid reprocessing data in case of Kafka diff --git a/core/src/main/scala/akka/kafka/internal/ControlImplementations.scala b/core/src/main/scala/akka/kafka/internal/ControlImplementations.scala index 2acaa6baf..9b2e71f58 100644 --- a/core/src/main/scala/akka/kafka/internal/ControlImplementations.scala +++ b/core/src/main/scala/akka/kafka/internal/ControlImplementations.scala @@ -17,7 +17,7 @@ import akka.stream.stage.GraphStageLogic import akka.util.Timeout import org.apache.kafka.common.{Metric, MetricName} -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.compat.java8.FutureConverters.{CompletionStageOps, FutureOps} import scala.concurrent.{ExecutionContext, Future, Promise} diff --git a/core/src/main/scala/akka/kafka/internal/KafkaConsumerActor.scala b/core/src/main/scala/akka/kafka/internal/KafkaConsumerActor.scala index 1c8093dda..1c3ffd0b2 100644 --- a/core/src/main/scala/akka/kafka/internal/KafkaConsumerActor.scala +++ b/core/src/main/scala/akka/kafka/internal/KafkaConsumerActor.scala @@ -34,7 +34,7 @@ import org.apache.kafka.common.errors.{ } import org.apache.kafka.common.{Metric, MetricName, TopicPartition} import scala.annotation.nowarn -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.concurrent.{ExecutionContext, Future} import scala.concurrent.duration._ import scala.util.{Success, Try} diff --git a/core/src/main/scala/akka/kafka/internal/MessageBuilder.scala b/core/src/main/scala/akka/kafka/internal/MessageBuilder.scala index a438f2b06..8eccfed88 100644 --- a/core/src/main/scala/akka/kafka/internal/MessageBuilder.scala +++ b/core/src/main/scala/akka/kafka/internal/MessageBuilder.scala @@ -22,7 +22,7 @@ import org.apache.kafka.common.requests.OffsetFetchResponse import scala.compat.java8.FutureConverters.FutureOps import scala.concurrent.Future -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ /** Internal API */ @InternalApi diff --git a/core/src/main/scala/akka/kafka/internal/PartitionAssignmentHelpers.scala b/core/src/main/scala/akka/kafka/internal/PartitionAssignmentHelpers.scala index f7a8033bd..075eae7e9 100644 --- a/core/src/main/scala/akka/kafka/internal/PartitionAssignmentHelpers.scala +++ b/core/src/main/scala/akka/kafka/internal/PartitionAssignmentHelpers.scala @@ -13,7 +13,7 @@ import akka.kafka.{AutoSubscription, RestrictedConsumer, TopicPartitionsAssigned import akka.stream.stage.AsyncCallback import org.apache.kafka.common.TopicPartition -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ /** * Internal API. diff --git a/core/src/main/scala/akka/kafka/internal/TransactionalProducerStage.scala b/core/src/main/scala/akka/kafka/internal/TransactionalProducerStage.scala index 7c7283672..1739af8e4 100644 --- a/core/src/main/scala/akka/kafka/internal/TransactionalProducerStage.scala +++ b/core/src/main/scala/akka/kafka/internal/TransactionalProducerStage.scala @@ -24,7 +24,7 @@ import org.apache.kafka.common.errors.ProducerFencedException import scala.concurrent.Future import scala.concurrent.duration._ -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.util.{Failure, Try} /** diff --git a/core/src/main/scala/akka/kafka/javadsl/Consumer.scala b/core/src/main/scala/akka/kafka/javadsl/Consumer.scala index 7ed4a3f9a..18fad2af9 100644 --- a/core/src/main/scala/akka/kafka/javadsl/Consumer.scala +++ b/core/src/main/scala/akka/kafka/javadsl/Consumer.scala @@ -19,7 +19,7 @@ import akka.{Done, NotUsed} import org.apache.kafka.clients.consumer.ConsumerRecord import org.apache.kafka.common.{Metric, MetricName, TopicPartition} -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.compat.java8.FutureConverters._ import scala.concurrent.duration.FiniteDuration diff --git a/core/src/main/scala/akka/kafka/javadsl/MetadataClient.scala b/core/src/main/scala/akka/kafka/javadsl/MetadataClient.scala index 6d34ad701..f2ffdf7b1 100644 --- a/core/src/main/scala/akka/kafka/javadsl/MetadataClient.scala +++ b/core/src/main/scala/akka/kafka/javadsl/MetadataClient.scala @@ -16,7 +16,7 @@ import org.apache.kafka.common.{PartitionInfo, TopicPartition} import scala.compat.java8.FutureConverters._ import scala.concurrent.ExecutionContextExecutor -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ class MetadataClient private (metadataClient: akka.kafka.scaladsl.MetadataClient) { diff --git a/testkit/src/main/scala/akka/kafka/testkit/ProducerResultFactory.scala b/testkit/src/main/scala/akka/kafka/testkit/ProducerResultFactory.scala index 81d94aa6a..d4be1948a 100644 --- a/testkit/src/main/scala/akka/kafka/testkit/ProducerResultFactory.scala +++ b/testkit/src/main/scala/akka/kafka/testkit/ProducerResultFactory.scala @@ -10,7 +10,7 @@ import akka.kafka.ProducerMessage import org.apache.kafka.clients.producer.{ProducerRecord, RecordMetadata} import org.apache.kafka.common.TopicPartition -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.collection.immutable /** diff --git a/testkit/src/main/scala/akka/kafka/testkit/internal/KafkaTestKit.scala b/testkit/src/main/scala/akka/kafka/testkit/internal/KafkaTestKit.scala index 8b37b92f2..1280acfc9 100644 --- a/testkit/src/main/scala/akka/kafka/testkit/internal/KafkaTestKit.scala +++ b/testkit/src/main/scala/akka/kafka/testkit/internal/KafkaTestKit.scala @@ -18,7 +18,7 @@ import org.apache.kafka.clients.consumer.ConsumerConfig import org.apache.kafka.common.serialization.{Deserializer, Serializer, StringDeserializer, StringSerializer} import org.slf4j.Logger -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ /** * Common functions for scaladsl and javadsl Testkit. diff --git a/testkit/src/main/scala/akka/kafka/testkit/internal/TestcontainersKafka.scala b/testkit/src/main/scala/akka/kafka/testkit/internal/TestcontainersKafka.scala index 583f54d8c..95179bda6 100644 --- a/testkit/src/main/scala/akka/kafka/testkit/internal/TestcontainersKafka.scala +++ b/testkit/src/main/scala/akka/kafka/testkit/internal/TestcontainersKafka.scala @@ -12,7 +12,7 @@ import org.testcontainers.containers.GenericContainer import org.testcontainers.utility.DockerImageName import scala.compat.java8.OptionConverters._ -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ object TestcontainersKafka { trait Spec extends KafkaSpec { diff --git a/testkit/src/main/scala/akka/kafka/testkit/scaladsl/KafkaSpec.scala b/testkit/src/main/scala/akka/kafka/testkit/scaladsl/KafkaSpec.scala index 8fce7d8a6..2a6e3e074 100644 --- a/testkit/src/main/scala/akka/kafka/testkit/scaladsl/KafkaSpec.scala +++ b/testkit/src/main/scala/akka/kafka/testkit/scaladsl/KafkaSpec.scala @@ -29,7 +29,7 @@ import org.slf4j.{Logger, LoggerFactory} import scala.collection.immutable import scala.concurrent.duration._ import scala.concurrent.{Await, ExecutionContext, Future} -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.util.Try abstract class KafkaSpec(_kafkaPort: Int, val zooKeeperPort: Int, actorSystem: ActorSystem) diff --git a/tests/src/it/scala/akka/kafka/IntegrationTests.scala b/tests/src/it/scala/akka/kafka/IntegrationTests.scala index bb7bae472..30a4bd6f2 100644 --- a/tests/src/it/scala/akka/kafka/IntegrationTests.scala +++ b/tests/src/it/scala/akka/kafka/IntegrationTests.scala @@ -11,7 +11,7 @@ import org.apache.kafka.common.TopicPartition import org.slf4j.Logger import org.testcontainers.containers.GenericContainer -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ object IntegrationTests { val MessageLogInterval = 500L diff --git a/tests/src/test/scala/akka/kafka/internal/CommittingProducerSinkSpec.scala b/tests/src/test/scala/akka/kafka/internal/CommittingProducerSinkSpec.scala index ba8860f6f..95f06a416 100644 --- a/tests/src/test/scala/akka/kafka/internal/CommittingProducerSinkSpec.scala +++ b/tests/src/test/scala/akka/kafka/internal/CommittingProducerSinkSpec.scala @@ -33,7 +33,7 @@ import org.slf4j.{Logger, LoggerFactory} import scala.collection.immutable import scala.concurrent.duration._ -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.concurrent.ExecutionContext class CommittingProducerSinkSpec(_system: ActorSystem) diff --git a/tests/src/test/scala/akka/kafka/internal/ConsumerMock.scala b/tests/src/test/scala/akka/kafka/internal/ConsumerMock.scala index 109b6e77d..9edee9a0d 100644 --- a/tests/src/test/scala/akka/kafka/internal/ConsumerMock.scala +++ b/tests/src/test/scala/akka/kafka/internal/ConsumerMock.scala @@ -17,7 +17,7 @@ import org.mockito.stubbing.Answer import org.mockito.verification.VerificationMode import org.mockito.{ArgumentMatchers, Mockito} -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.collection.immutable.Seq import scala.concurrent.duration._ diff --git a/tests/src/test/scala/akka/kafka/internal/ConsumerProgressTrackingSpec.scala b/tests/src/test/scala/akka/kafka/internal/ConsumerProgressTrackingSpec.scala index f7445bcdf..5851f80cb 100644 --- a/tests/src/test/scala/akka/kafka/internal/ConsumerProgressTrackingSpec.scala +++ b/tests/src/test/scala/akka/kafka/internal/ConsumerProgressTrackingSpec.scala @@ -12,7 +12,7 @@ import org.mockito.Mockito import org.scalatest.flatspec.AnyFlatSpecLike import org.scalatest.matchers.should.Matchers -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.language.reflectiveCalls class ConsumerProgressTrackingSpec extends AnyFlatSpecLike with Matchers with LogCapturing { diff --git a/tests/src/test/scala/akka/kafka/internal/ConsumerResetProtectionSpec.scala b/tests/src/test/scala/akka/kafka/internal/ConsumerResetProtectionSpec.scala index f930eda8b..e7ce4ca13 100644 --- a/tests/src/test/scala/akka/kafka/internal/ConsumerResetProtectionSpec.scala +++ b/tests/src/test/scala/akka/kafka/internal/ConsumerResetProtectionSpec.scala @@ -22,7 +22,7 @@ import org.slf4j.{Logger, LoggerFactory} import java.util.Optional import scala.concurrent.duration._ -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ class ConsumerResetProtectionSpec extends TestKit(ActorSystem("ConsumerResetProtectionSpec")) diff --git a/tests/src/test/scala/akka/kafka/internal/ConsumerSpec.scala b/tests/src/test/scala/akka/kafka/internal/ConsumerSpec.scala index 5d057c15a..6fc5fb525 100644 --- a/tests/src/test/scala/akka/kafka/internal/ConsumerSpec.scala +++ b/tests/src/test/scala/akka/kafka/internal/ConsumerSpec.scala @@ -28,7 +28,7 @@ import org.scalatest.matchers.should.Matchers import scala.collection.immutable.Seq import scala.concurrent.duration._ import scala.concurrent.{Await, ExecutionContext, Future} -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ object ConsumerSpec { type K = String diff --git a/tests/src/test/scala/akka/kafka/internal/PartitionedSourceSpec.scala b/tests/src/test/scala/akka/kafka/internal/PartitionedSourceSpec.scala index 97a86d801..8807312a2 100644 --- a/tests/src/test/scala/akka/kafka/internal/PartitionedSourceSpec.scala +++ b/tests/src/test/scala/akka/kafka/internal/PartitionedSourceSpec.scala @@ -31,7 +31,7 @@ import org.slf4j.{Logger, LoggerFactory} import scala.concurrent.{ExecutionContext, Future} import scala.concurrent.duration._ -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ class PartitionedSourceSpec(_system: ActorSystem) extends TestKit(_system) diff --git a/tests/src/test/scala/akka/kafka/internal/ProducerSpec.scala b/tests/src/test/scala/akka/kafka/internal/ProducerSpec.scala index bdb44b5c2..c34f8d258 100644 --- a/tests/src/test/scala/akka/kafka/internal/ProducerSpec.scala +++ b/tests/src/test/scala/akka/kafka/internal/ProducerSpec.scala @@ -39,7 +39,7 @@ import org.scalatest.matchers.should.Matchers import java.util.Optional import scala.concurrent.duration._ import scala.concurrent.{Await, ExecutionContext, Future, Promise} -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.util.{Failure, Success, Try} object ProducerSpec { diff --git a/tests/src/test/scala/akka/kafka/scaladsl/RebalanceSpec.scala b/tests/src/test/scala/akka/kafka/scaladsl/RebalanceSpec.scala index 549d37be5..940083da7 100644 --- a/tests/src/test/scala/akka/kafka/scaladsl/RebalanceSpec.scala +++ b/tests/src/test/scala/akka/kafka/scaladsl/RebalanceSpec.scala @@ -23,7 +23,7 @@ import org.scalatest.Inside import org.slf4j.{Logger, LoggerFactory} import scala.concurrent.duration._ -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.util.Random class RebalanceSpec extends SpecBase with TestcontainersKafkaLike with Inside { diff --git a/tests/src/test/scala/akka/kafka/scaladsl/RetentionPeriodSpec.scala b/tests/src/test/scala/akka/kafka/scaladsl/RetentionPeriodSpec.scala index a2f3d4ab0..f51b4551a 100644 --- a/tests/src/test/scala/akka/kafka/scaladsl/RetentionPeriodSpec.scala +++ b/tests/src/test/scala/akka/kafka/scaladsl/RetentionPeriodSpec.scala @@ -17,7 +17,7 @@ import akka.stream.testkit.scaladsl.TestSink import scala.concurrent.Await import scala.concurrent.duration._ -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ class RetentionPeriodSpec extends SpecBase with TestcontainersKafkaPerClassLike { private final val confluentPlatformVersion = "5.0.0" diff --git a/tests/src/test/scala/akka/kafka/scaladsl/TimestampSpec.scala b/tests/src/test/scala/akka/kafka/scaladsl/TimestampSpec.scala index 26f5ab1d4..da4600d73 100644 --- a/tests/src/test/scala/akka/kafka/scaladsl/TimestampSpec.scala +++ b/tests/src/test/scala/akka/kafka/scaladsl/TimestampSpec.scala @@ -13,7 +13,7 @@ import org.apache.kafka.common.TopicPartition import org.scalatest.Inside import org.scalatest.concurrent.IntegrationPatience -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ import scala.concurrent.Await import scala.concurrent.duration._ diff --git a/tests/src/test/scala/akka/kafka/tests/CapturingAppender.scala b/tests/src/test/scala/akka/kafka/tests/CapturingAppender.scala index a5fce82f7..9b5fb3b59 100644 --- a/tests/src/test/scala/akka/kafka/tests/CapturingAppender.scala +++ b/tests/src/test/scala/akka/kafka/tests/CapturingAppender.scala @@ -76,7 +76,7 @@ import ch.qos.logback.core.AppenderBase * Also clears the buffer.. */ def flush(): Unit = synchronized { - import scala.collection.JavaConverters._ + import scala.jdk.CollectionConverters._ val logbackLogger = getLogbackLogger(classOf[CapturingAppender].getName + "Delegate") val appenders = logbackLogger.iteratorForAppenders().asScala.filterNot(_ == this).toList for (event <- buffer; appender <- appenders) { diff --git a/tests/src/test/scala/docs/scaladsl/SchemaRegistrySerializationSpec.scala b/tests/src/test/scala/docs/scaladsl/SchemaRegistrySerializationSpec.scala index 72d6dabd3..c7a3b94f5 100644 --- a/tests/src/test/scala/docs/scaladsl/SchemaRegistrySerializationSpec.scala +++ b/tests/src/test/scala/docs/scaladsl/SchemaRegistrySerializationSpec.scala @@ -32,7 +32,7 @@ import org.apache.kafka.clients.producer.ProducerRecord // #imports import org.apache.kafka.common.serialization._ // #imports -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ // #schema-registry-settings class SchemaRegistrySerializationSpec extends DocsSpecBase with TestcontainersKafkaPerClassLike {