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
This commit is contained in:
Mats Julian Olsen 2017-10-06 12:35:19 -07:00 committed by Guozhang Wang
parent 974d6fec93
commit fb6ca658d6
1 changed files with 2 additions and 6 deletions

View File

@ -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")