Packages

t

org.apache.pekko.kafka.testkit.scaladsl

TestcontainersKafkaPerClassLike

trait TestcontainersKafkaPerClassLike extends KafkaSpec with Spec

Uses Testcontainers to start a Kafka broker in a Docker container once per class. The Testcontainers dependency has to be added explicitly.

Source
TestcontainersKafkaPerClassLike.scala
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TestcontainersKafkaPerClassLike
  2. Spec
  3. KafkaSpec
  4. KafkaTestKit
  5. TestKit
  6. TestKitBase
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. val DefaultKey: String
    Definition Classes
    KafkaTestKit
  2. val StringDeserializer: StringDeserializer
    Definition Classes
    KafkaTestKit
  3. val StringSerializer: StringSerializer
    Definition Classes
    KafkaTestKit
  4. implicit val adapter: LoggingAdapter
    Definition Classes
    KafkaSpec
  5. def adminClient: Admin

    Access to the Kafka Admin client

    Access to the Kafka Admin client

    Definition Classes
    KafkaTestKit
  6. def assertForDuration[A](a: => A, max: FiniteDuration, interval: Duration): A
    Definition Classes
    TestKitBase
  7. def awaitAssert[A](a: => A, max: Duration, interval: Duration): A
    Definition Classes
    TestKitBase
  8. def awaitCond(p: => Boolean, max: Duration, interval: Duration, message: String): Unit
    Definition Classes
    TestKitBase
  9. def awaitMultiple[T](d: FiniteDuration, futures: Future[T]*): Seq[T]
    Definition Classes
    KafkaSpec
  10. def awaitProduce(futures: Future[Done]*): Unit
    Definition Classes
    KafkaSpec
  11. def batchMessagesExpected(topics: Seq[String], batches: Int, batchSize: Int): (Seq[String], Long)

    Messages expected from #produceBatches generation.

    Messages expected from #produceBatches generation.

    Definition Classes
    KafkaSpec
  12. def bootstrapServers: String
    Definition Classes
    SpecKafkaTestKit
  13. def brokerContainers: Vector[PekkoConnectorsKafkaContainer]
    Definition Classes
    Spec
  14. def childActorOf(props: Props): ActorRef
    Definition Classes
    TestKitBase
  15. def childActorOf(props: Props, name: String): ActorRef
    Definition Classes
    TestKitBase
  16. def childActorOf(props: Props, supervisorStrategy: SupervisorStrategy): ActorRef
    Definition Classes
    TestKitBase
  17. def childActorOf(props: Props, name: String, supervisorStrategy: SupervisorStrategy): ActorRef
    Definition Classes
    TestKitBase
  18. def cleanUp(): Unit
  19. def cleanUpAdminClient(): Unit

    Close internal admin client instances.

    Close internal admin client instances.

    Definition Classes
    KafkaTestKit
  20. def committerDefaults: CommitterSettings
    Definition Classes
    KafkaTestKit
  21. def consumerDefaults[K, V](keyDeserializer: Deserializer[K], valueDeserializer: Deserializer[V]): ConsumerSettings[K, V]
    Definition Classes
    KafkaTestKit
  22. def consumerDefaults: ConsumerSettings[String, String]
    Definition Classes
    KafkaTestKit
  23. def createGroupId(suffix: Int): String

    Return a unique group id with a given suffix.

    Return a unique group id with a given suffix.

    Definition Classes
    KafkaTestKit
  24. def createGroupId(): String

    Return a unique group id with a default suffix.

    Return a unique group id with a default suffix.

    Definition Classes
    KafkaTestKit
  25. def createProbe(consumerSettings: ConsumerSettings[String, String], topic: String*): (Control, Probe[String])
    Definition Classes
    KafkaSpec
  26. def createTopic(suffix: Int, partitions: Int, replication: Int, config: Map[String, String]): String

    Java Api

    Java Api

    Create a topic with given suffix, partition number, replication factor, and topic configuration.

    This method will block and return only when the topic has been successfully created.

    Definition Classes
    KafkaTestKit
  27. def createTopic(suffix: Int, partitions: Int, replication: Int, config: Map[String, String]): String

    Create a topic with given suffix, partition number, replication factor, and topic configuration.

    Create a topic with given suffix, partition number, replication factor, and topic configuration.

    This method will block and return only when the topic has been successfully created.

    Definition Classes
    KafkaTestKit
  28. def createTopic(suffix: Int, partitions: Int, replication: Int): String

    Create a topic with given suffix, partition number, replication factor, and no topic configuration.

    Create a topic with given suffix, partition number, replication factor, and no topic configuration.

    This method will block and return only when the topic has been successfully created.

    Definition Classes
    KafkaTestKit
  29. def createTopic(suffix: Int, partitions: Int): String

    Create a topic with a given suffix, partition number, a replication factor of one, and no topic configuration.

    Create a topic with a given suffix, partition number, a replication factor of one, and no topic configuration.

    This method will block and return only when the topic has been successfully created.

    Definition Classes
    KafkaTestKit
  30. def createTopic(suffix: Int): String

    Create a topic with a given suffix, single partitions, a replication factor of one, and no topic configuration.

    Create a topic with a given suffix, single partitions, a replication factor of one, and no topic configuration.

    This method will block and return only when the topic has been successfully created.

    Definition Classes
    KafkaTestKit
  31. def createTopic(): String

    Create a topic with a default suffix, single partition, a replication factor of one, and no topic configuration.

    Create a topic with a default suffix, single partition, a replication factor of one, and no topic configuration.

    This method will block and return only when the topic has been successfully created.

    Definition Classes
    KafkaTestKit
  32. def createTopicName(suffix: Int): String

    Return a unique topic name.

    Return a unique topic name.

    Definition Classes
    KafkaTestKit
  33. def createTopics(topics: Int*): Seq[String]
    Definition Classes
    KafkaSpec
  34. def createTransactionalId(suffix: Int): String

    Return a unique transactional id with a given suffix.

    Return a unique transactional id with a given suffix.

    Definition Classes
    KafkaTestKit
  35. def createTransactionalId(): String

    Return a unique transactional id with a default suffix.

    Return a unique transactional id with a default suffix.

    Definition Classes
    KafkaTestKit
  36. implicit val ec: ExecutionContext
    Definition Classes
    KafkaSpec
  37. def expectMsg[T](max: FiniteDuration, hint: String, obj: T): T
    Definition Classes
    TestKitBase
  38. def expectMsg[T](max: FiniteDuration, obj: T): T
    Definition Classes
    TestKitBase
  39. def expectMsg[T](obj: T): T
    Definition Classes
    TestKitBase
  40. def expectMsgAllClassOf[T](max: FiniteDuration, obj: Class[_ <: T]*): Seq[T]
    Definition Classes
    TestKitBase
  41. def expectMsgAllClassOf[T](obj: Class[_ <: T]*): Seq[T]
    Definition Classes
    TestKitBase
  42. def expectMsgAllConformingOf[T](max: FiniteDuration, obj: Class[_ <: T]*): Seq[T]
    Definition Classes
    TestKitBase
  43. def expectMsgAllConformingOf[T](obj: Class[_ <: T]*): Seq[T]
    Definition Classes
    TestKitBase
  44. def expectMsgAllOf[T](max: FiniteDuration, obj: T*): Seq[T]
    Definition Classes
    TestKitBase
  45. def expectMsgAllOf[T](obj: T*): Seq[T]
    Definition Classes
    TestKitBase
  46. def expectMsgAnyClassOf[C](max: FiniteDuration, obj: Class[_ <: C]*): C
    Definition Classes
    TestKitBase
  47. def expectMsgAnyClassOf[C](obj: Class[_ <: C]*): C
    Definition Classes
    TestKitBase
  48. def expectMsgAnyOf[T](max: FiniteDuration, obj: T*): T
    Definition Classes
    TestKitBase
  49. def expectMsgAnyOf[T](obj: T*): T
    Definition Classes
    TestKitBase
  50. def expectMsgClass[C](max: FiniteDuration, c: Class[C]): C
    Definition Classes
    TestKitBase
  51. def expectMsgClass[C](c: Class[C]): C
    Definition Classes
    TestKitBase
  52. def expectMsgPF[T](max: Duration, hint: String)(f: PartialFunction[Any, T]): T
    Definition Classes
    TestKitBase
  53. def expectMsgType[T](max: FiniteDuration)(implicit t: ClassTag[T]): T
    Definition Classes
    TestKitBase
  54. def expectMsgType[T](implicit t: ClassTag[T]): T
    Definition Classes
    TestKitBase
  55. def expectNoMessage(): Unit
    Definition Classes
    TestKitBase
  56. def expectNoMessage(max: FiniteDuration): Unit
    Definition Classes
    TestKitBase
  57. def expectTerminated(target: ActorRef, max: Duration): Terminated
    Definition Classes
    TestKitBase
  58. def fishForMessage(max: Duration, hint: String)(f: PartialFunction[Any, Boolean]): Any
    Definition Classes
    TestKitBase
  59. def fishForSpecificMessage[T](max: Duration, hint: String)(f: PartialFunction[Any, T]): T
    Definition Classes
    TestKitBase
  60. def getSchemaRegistryUrl: String
    Definition Classes
    Spec
  61. def ignoreMsg(f: PartialFunction[Any, Boolean]): Unit
    Definition Classes
    TestKitBase
  62. def ignoreNoMsg(): Unit
    Definition Classes
    TestKitBase
  63. def kafkaPort: Int
    Definition Classes
    SpecKafkaSpec
  64. def lastSender: ActorRef
    Definition Classes
    TestKitBase
  65. val log: Logger
    Definition Classes
    KafkaSpecKafkaTestKit
  66. implicit val mat: Materializer
    Definition Classes
    KafkaSpec
  67. def msgAvailable: Boolean
    Definition Classes
    TestKitBase
  68. def now: FiniteDuration
    Definition Classes
    TestKitBase
  69. val partition0: Int
    Definition Classes
    KafkaSpec
  70. def periodicalCheck[T](description: String, maxTries: Int, sleepInBetween: FiniteDuration)(data: () => T)(predicate: (T) => Boolean): Unit
    Definition Classes
    KafkaSpec
  71. def produce(topic: String, range: Range, settings: ProducerSettings[String, String]): Future[Done]

    Produce messages to topic using specified range and return a Future so the caller can synchronize consumption.

    Produce messages to topic using specified range and return a Future so the caller can synchronize consumption.

    Definition Classes
    KafkaSpec
  72. def produce(topic: String, range: Seq[Int], partition: Int = partition0): Future[Done]

    Produce messages to topic using specified range and return a Future so the caller can synchronize consumption.

    Produce messages to topic using specified range and return a Future so the caller can synchronize consumption.

    Definition Classes
    KafkaSpec
  73. def produceBatches(topics: Seq[String], batches: Int, batchSize: Int): Future[Seq[Done]]

    Produce batches over several topics.

    Produce batches over several topics.

    Definition Classes
    KafkaSpec
  74. def produceString(topic: String, range: Seq[String], partition: Int = partition0): Future[Done]
    Definition Classes
    KafkaSpec
  75. def produceTimestamped(topic: String, timestampedRange: Seq[(Int, Long)]): Future[Done]
    Definition Classes
    KafkaSpec
  76. def producerDefaults[K, V](keySerializer: Serializer[K], valueSerializer: Serializer[V]): ProducerSettings[K, V]
    Definition Classes
    KafkaTestKit
  77. def producerDefaults: ProducerSettings[String, String]
    Definition Classes
    KafkaTestKit
  78. def receiveN(n: Int, max: FiniteDuration): Seq[AnyRef]
    Definition Classes
    TestKitBase
  79. def receiveN(n: Int): Seq[AnyRef]
    Definition Classes
    TestKitBase
  80. def receiveOne(max: Duration): AnyRef
    Definition Classes
    TestKitBase
  81. def receiveWhile[T](max: Duration, idle: Duration, messages: Int)(f: PartialFunction[AnyRef, T]): Seq[T]
    Definition Classes
    TestKitBase
  82. def remaining: FiniteDuration
    Definition Classes
    TestKitBase
  83. def remainingOr(duration: FiniteDuration): FiniteDuration
    Definition Classes
    TestKitBase
  84. def remainingOrDefault: FiniteDuration
    Definition Classes
    TestKitBase
  85. implicit val scheduler: Scheduler
    Definition Classes
    KafkaSpec
  86. def schemaRegistryContainer: Option[SchemaRegistryContainer]
    Definition Classes
    Spec
  87. def schemaRegistryUrl: String
    Definition Classes
    Spec
  88. def setAutoPilot(pilot: AutoPilot): Unit
    Definition Classes
    TestKitBase
  89. def setUp(): Unit
  90. def setUpAdminClient(): Unit

    Create internal admin clients.

    Create internal admin clients. Gives access to adminClient, be sure to call cleanUpAdminClient after the tests are done.

    Definition Classes
    KafkaTestKit
  91. val settings: KafkaTestkitSettings
    Definition Classes
    KafkaTestKit
  92. def shutdown(actorSystem: ActorSystem, duration: Duration, verifySystemShutdown: Boolean): Unit
    Definition Classes
    TestKitBase
  93. def sleep(time: FiniteDuration, msg: String = ""): Unit
    Definition Classes
    KafkaSpec
  94. def sleepAfterProduce: FiniteDuration
    Definition Classes
    KafkaSpec
  95. def sleepMillis(ms: Long, msg: String): Unit
    Definition Classes
    KafkaTestKit
  96. def sleepQuietly(time: FiniteDuration): Unit
    Definition Classes
    KafkaSpec
  97. def sleepSeconds(s: Int, msg: String): Unit
    Definition Classes
    KafkaTestKit
  98. def startCluster(settings: KafkaTestkitTestcontainersSettings): String
    Definition Classes
    Spec
  99. def startCluster(): String
    Definition Classes
    Spec
  100. def startKafka(): Unit
    Definition Classes
    Spec
  101. def stopCluster(): Unit
    Definition Classes
    Spec
  102. def stopKafka(): Unit
    Definition Classes
    Spec
  103. implicit val system: ActorSystem
    Definition Classes
    TestKit → TestKitBase
  104. lazy val testActor: ActorRef
    Definition Classes
    TestKitBase
  105. def testKitSettings: TestKitSettings
    Definition Classes
    TestKitBase
  106. var testProducer: Producer[String, String]
    Definition Classes
    KafkaSpec
  107. val testcontainersSettings: KafkaTestkitTestcontainersSettings

    Override this to change default settings for starting the Kafka testcontainers cluster.

    Override this to change default settings for starting the Kafka testcontainers cluster.

    Definition Classes
    Spec
  108. def unwatch(ref: ActorRef): ActorRef
    Definition Classes
    TestKitBase
  109. def waitUntilCluster()(predicate: (DescribeClusterResult) => Boolean): Unit

    Periodically checks if a given predicate on cluster state holds.

    Periodically checks if a given predicate on cluster state holds.

    If the predicate does not hold after configured amount of time, throws an exception.

    Definition Classes
    KafkaSpec
  110. def waitUntilConsumerGroup(groupId: String)(predicate: (ConsumerGroupDescription) => Boolean): Unit

    Periodically checks if the given predicate on consumer group state holds.

    Periodically checks if the given predicate on consumer group state holds.

    If the predicate does not hold after configured amount of time, throws an exception.

    Definition Classes
    KafkaSpec
  111. def waitUntilConsumerSummary(groupId: String)(predicate: PartialFunction[List[MemberDescription], Boolean]): Unit

    Periodically checks if the given predicate on consumer summary holds.

    Periodically checks if the given predicate on consumer summary holds.

    If the predicate does not hold after configured amount of time, throws an exception.

    Definition Classes
    KafkaSpec
  112. def watch(ref: ActorRef): ActorRef
    Definition Classes
    TestKitBase
  113. def within[T](max: FiniteDuration)(f: => T): T
    Definition Classes
    TestKitBase
  114. def within[T](min: FiniteDuration, max: FiniteDuration)(f: => T): T
    Definition Classes
    TestKitBase
  115. val zooKeeperPort: Int
    Definition Classes
    KafkaSpec
  116. def zookeeperContainer: GenericContainer[_]
    Definition Classes
    Spec

Deprecated Value Members

  1. def expectNoMsg(max: FiniteDuration): Unit
    Definition Classes
    TestKitBase
    Annotations
    @deprecated
    Deprecated

    (Since version Akka 2.5.5) Use expectNoMessage instead

  2. def expectNoMsg(): Unit
    Definition Classes
    TestKitBase
    Annotations
    @deprecated
    Deprecated

    (Since version Akka 2.5.5) Use expectNoMessage instead