kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: MINOR: Allow schedule and commit in MockProcessorContext
Date Fri, 06 Oct 2017 19:35:22 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 974d6fec9 -> fb6ca658d


MINOR: Allow schedule and commit in MockProcessorContext

This change allows for testing custom Processors and Transformers that call `schedule` and
`commit` using KStreamTestDriver, by _not_ throwing `UnsupportedOperationException`.

This PR is my original work.

Author: Mats Julian Olsen <mats@plysjbyen.net>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #3992 from mewwts/allow-schedule-and-commit


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/fb6ca658
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/fb6ca658
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/fb6ca658

Branch: refs/heads/trunk
Commit: fb6ca658d699d41fb9e6a647e92b1382ea1aaa65
Parents: 974d6fe
Author: Mats Julian Olsen <mats@plysjbyen.net>
Authored: Fri Oct 6 12:35:19 2017 -0700
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Fri Oct 6 12:35:19 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/kafka/test/MockProcessorContext.java     | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/fb6ca658/streams/src/test/java/org/apache/kafka/test/MockProcessorContext.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/test/MockProcessorContext.java b/streams/src/test/java/org/apache/kafka/test/MockProcessorContext.java
index 37a8ab3..70568bf 100644
--- a/streams/src/test/java/org/apache/kafka/test/MockProcessorContext.java
+++ b/streams/src/test/java/org/apache/kafka/test/MockProcessorContext.java
@@ -164,14 +164,10 @@ public class MockProcessorContext extends AbstractProcessorContext implements
Re
     }
 
     @Override
-    public void schedule(final long interval) {
-        throw new UnsupportedOperationException("schedule() not supported.");
-    }
+    public void schedule(final long interval) { }
 
     @Override
-    public void commit() {
-        throw new UnsupportedOperationException("commit() not supported.");
-    }
+    public void commit() { }
 
     @Override
     @SuppressWarnings("unchecked")


Mime
View raw message