flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tillrohrmann <...@git.apache.org>
Subject [GitHub] flink pull request #3278: [FLINK-5701] [kafka] FlinkKafkaProducer should che...
Date Wed, 08 Feb 2017 10:12:19 GMT
Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3278#discussion_r100030887
  
    --- Diff: flink-connectors/flink-connector-kafka-base/src/test/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducerBaseTest.java
---
    @@ -293,6 +293,61 @@ public void run() {
     		testHarness.close();
     	}
     
    +	/**
    +	 * This test is meant to assure that testAtLeastOnceProducer is valid by testing that
if flushing is disabled,
    +	 * the snapshot method does indeed finishes without waiting for pending records;
    +	 * we set a timeout because the test will not finish if the logic is broken
    +	 */
    +	@Test(timeout=5000)
    +	public void testDoesNotWaitForPendingRecordsIfFlushingDisabled() throws Throwable {
    +		final OneShotLatch inputLatch = new OneShotLatch();
    +
    +		final DummyFlinkKafkaProducer<String> producer = new DummyFlinkKafkaProducer<>(
    --- End diff --
    
    Can't we simply give this instance a mock `KafkaProducer`? Then we could easily check
via `verify` whether the `send` method has been called.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message