diff --git a/kafka-connect-neo4j/src/test/kotlin/streams/kafka/connect/source/Neo4jSourceTaskTest.kt b/kafka-connect-neo4j/src/test/kotlin/streams/kafka/connect/source/Neo4jSourceTaskTest.kt index f6746dbf..1d719f65 100644 --- a/kafka-connect-neo4j/src/test/kotlin/streams/kafka/connect/source/Neo4jSourceTaskTest.kt +++ b/kafka-connect-neo4j/src/test/kotlin/streams/kafka/connect/source/Neo4jSourceTaskTest.kt @@ -290,7 +290,17 @@ class Neo4jSourceTaskTest { val totalRecords = 10 insertRecords(totalRecords) - task.poll() + var exception: ConnectException? = null + Assert.assertEventually(ThrowingSupplier { + try { + task.poll() + false + } catch (e: ConnectException) { + exception = e + true + } + }, Matchers.equalTo(true), 30, TimeUnit.SECONDS) + if (exception != null) throw exception as ConnectException } @Test