mdespriee commented on a change in pull request #9738:
URL: https://github.com/apache/kafka/pull/9738#discussion_r565497044



##########
File path: 
streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/KTableTest.scala
##########
@@ -391,4 +390,57 @@ class KTableTest extends FlatSpec with Matchers with 
TestDriver {
 
     testDriver.close()
   }
+
+  "setting a name on a filter processor" should "pass the name to the 
topology" in {
+    val builder = new StreamsBuilder()
+    val sourceTopic = "source"
+    val sinkTopic = "sink"
+
+    val table = builder.stream[String, String](sourceTopic).groupBy((key, _) 
=> key).count()
+    table
+      .filter((key, value) => key.equals("a") && value == 1, 
Named.as("my-name"))
+      .toStream
+      .to(sinkTopic)
+
+    import scala.jdk.CollectionConverters._
+
+    val filterNode = 
builder.build().describe().subtopologies().asScala.toList(1).nodes().asScala.toList(3)
+    filterNode.name() shouldBe "my-name"
+  }
+
+  "setting a name on a count processor" should "pass the name to the topology" 
in {
+    val builder = new StreamsBuilder()
+    val sourceTopic = "source"
+    val sinkTopic = "sink"
+
+    val table = builder.stream[String, String](sourceTopic).groupBy((key, _) 
=> key).count(Named.as("my-name"))
+    table.toStream.to(sinkTopic)
+
+    import scala.jdk.CollectionConverters._
+
+    val filterNode = 
builder.build().describe().subtopologies().asScala.toList(1).nodes().asScala.toList(1)
+    filterNode.name() shouldBe "my-name"

Review comment:
       bad copy-paste of variable name.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to