You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by he...@apache.org on 2023/06/10 12:48:36 UTC
[incubator-pekko-connectors] 03/06: Update MqttFlowSpec.scala
This is an automated email from the ASF dual-hosted git repository.
hepin pushed a commit to branch scala3
in repository https://gitbox.apache.org/repos/asf/incubator-pekko-connectors.git
commit b99fe7e6c4a7f68e27188f541f919637363fbb35
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Sat Jun 10 11:50:53 2023 +0100
Update MqttFlowSpec.scala
---
.../test/scala/docs/scaladsl/MqttFlowSpec.scala | 25 ++++++++++------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/mqtt-streaming/src/test/scala/docs/scaladsl/MqttFlowSpec.scala b/mqtt-streaming/src/test/scala/docs/scaladsl/MqttFlowSpec.scala
index da022cfba..36f7f7401 100644
--- a/mqtt-streaming/src/test/scala/docs/scaladsl/MqttFlowSpec.scala
+++ b/mqtt-streaming/src/test/scala/docs/scaladsl/MqttFlowSpec.scala
@@ -36,33 +36,30 @@ import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpecLike
class UntypedMqttFlowSpec
- extends ParameterizedTestKit("untyped-flow-spec/flow",
+ extends MqttFlowSpecBase("untyped-flow-spec/flow",
"untyped-flow-spec/topic1",
ActorSystem("UntypedMqttFlowSpec"))
- with MqttFlowSpec
+
class TypedMqttFlowSpec
- extends ParameterizedTestKit("typed-flow-spec/flow",
+ extends MqttFlowSpecBase("typed-flow-spec/flow",
"typed-flow-spec/topic1",
org.apache.pekko.actor.typed.ActorSystem(Behaviors.ignore, "TypedMqttFlowSpec").toClassic)
- with MqttFlowSpec
-
-class ParameterizedTestKit(val clientId: String, val topic: String, system: ActorSystem) extends TestKit(system) {
- def actorSystem: ActorSystem = system
-}
-trait MqttFlowSpec extends AnyWordSpecLike with Matchers with BeforeAndAfterAll with ScalaFutures with LogCapturing {
- self: ParameterizedTestKit =>
+abstract class MqttFlowSpecBase(val clientId: String, val topic: String, system: ActorSystem) extends TestKit(system) with AnyWordSpecLike with Matchers with BeforeAndAfterAll with ScalaFutures with LogCapturing {
- override def sourceActorSytem = Some(actorSystem.name)
+ override def sourceActorSytem = Some(system.name)
private implicit val defaultPatience: PatienceConfig = PatienceConfig(timeout = 5.seconds, interval = 100.millis)
- private implicit val dispatcherExecutionContext: ExecutionContext = actorSystem.dispatcher
+ private implicit val dispatcherExecutionContext: ExecutionContext = system.dispatcher
+
+ private implicit val implicitSystem: ActorSystem = system
+
+ implicit val logAdapter: LoggingAdapter = Logging(system, this.getClass.getName)
- implicit val logAdapter: LoggingAdapter = Logging(actorSystem, this.getClass.getName)
override def afterAll(): Unit =
- TestKit.shutdownActorSystem(actorSystem)
+ TestKit.shutdownActorSystem(system)
"mqtt client flow" should {
"establish a bidirectional connection and subscribe to a topic" in assertAllStagesStopped {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org