mirror of https://github.com/apache/kafka.git
MINOR: fix bug in MockConsumer (#19627)
The setter of `maxPollRecords` wrongly checks the field instead of the argument. Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, TengYao Chi <frankvicky@apache.org>
This commit is contained in:
parent
28ad4dd5c5
commit
44025d8116
|
|
@ -335,7 +335,7 @@ public class MockConsumer<K, V> implements Consumer<K, V> {
|
||||||
* @param maxPollRecords the max.poll.records.
|
* @param maxPollRecords the max.poll.records.
|
||||||
*/
|
*/
|
||||||
public synchronized void setMaxPollRecords(long maxPollRecords) {
|
public synchronized void setMaxPollRecords(long maxPollRecords) {
|
||||||
if (this.maxPollRecords < 1) {
|
if (maxPollRecords < 1) {
|
||||||
throw new IllegalArgumentException("MaxPollRecords must be strictly superior to 0");
|
throw new IllegalArgumentException("MaxPollRecords must be strictly superior to 0");
|
||||||
}
|
}
|
||||||
this.maxPollRecords = maxPollRecords;
|
this.maxPollRecords = maxPollRecords;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue