-
Bug
-
Resolution: Done
-
Major
-
1.9.2.Final, 2.0.0.Alpha1
-
None
-
False
-
None
-
False
When a test calls DebeziumContainer#getConnectorTaskState, it is possible that the returned tasks array is empty as the Kafka Connect container may not have yet started the tasks. When this happens, a NullPointerException is raised.
I propose a small check in the method such as:
final JsonNode tasksNode = parsedObject.get("tasks").get(taskNumber); if (tasksNode == null) { return null; } return Connector.State.valueOf(tasksNode.get("state").asText());
This way if the specific task has not yet started, we avoid the NPE by returning null and allowing the caller's Awaility method to re-check periodically without failure.