Hi All,
Im looking for material/guidance on how best to implement process unit tests with process models using connectors.
Im aiming to use the zeebe process test framework, however my question is how best to use this with connectors? Do I need to create mocks for the connectors? Any recommendations or examples?
regards
Rob
Hi @Webcyberrob ,
did you find any solutions? If so, I’d be interested to hear your insights.
As a workaround I created a dummy implementation for the process tests which then at least prevents the process from hanging:
@Component
@Profile("test")
@Slf4j
public class MyKafkaConnector {
@JobWorker(type = "io.camunda:connector-kafka:1")
public void handleMyKafkaConnector(ActivatedJob job) {
log.info("Dummy implementation for 'io.camunda:connector-kafka:1' connector {}", job.getKey());
}
}
Best,
Tobias
Hi Tobias,
The path we are going down is to use Mockito and tbus mock the connector calls…
In the Camunda git repos, this seems to be the path the core devs take, so we are using the camunda test code fir inspiration and guidance …
Regards
Rob
Hey @Webcyberrob and @tobiasschaefer, we are now increasing our e2e testing coverage. Maybe its an interesting source for inspiration on how to test your element templates including your connector implementations against an actual zeebe runtime: connectors/connectors-e2e-test at main · camunda/connectors · GitHub
1 Like
As an inspiration, I created an integration test case for my connector here. It uses ZPT with an active Camunda REST connector. The test is based on the e2e tests from the connectors repository.
2 Likes