test-worker

Generate unit tests for Zeebe @JobWorker classes using mockk or Mockito.

3|Updated Feb 6, 2025
One-click install
npx skills add https://github.com/emaarco/easy-zeebe --skill test-worker
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-worker
Source: https://github.com/emaarco/easy-zeebe/tree/main/.claude/skills/test-worker
Command: npx skills add https://github.com/emaarco/easy-zeebe --skill test-worker

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation of unit tests for Zeebe job worker classes, ensuring code quality and maintainability without the overhead of a full testing environment.

Core Features & Use Cases

  • Automated Test Generation: Creates unit tests for @JobWorker classes using mockk (Kotlin) or Mockito (Java).
  • Context-Free Testing: Tests run without Spring context or Camunda test runtime, focusing purely on worker logic.
  • Use Case: When you've written a new Zeebe worker to process a specific task, use this Skill to quickly generate a robust unit test that verifies its behavior against its use case.

Quick Start

Use the test-worker skill to generate a unit test for the file '/services/example-service/src/main/kotlin/io/zeebe/example/importer/ZeebeImporter.kt'.

Frequently Asked Questions about test-worker

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate unit tests for Zeebe job workers?

You generate unit tests for Zeebe job workers by utilizing an automated scaffolding tool that creates isolated tests using mockk for Kotlin or Mockito for Java. This approach excludes the Spring context and Camunda test runtime to verify pure worker logic.

Can I test Zeebe @JobWorker classes without loading the Spring context?

Yes, you can test Zeebe @JobWorker classes without loading the Spring context. Automated test generation creates isolated unit tests utilizing mockk or Mockito, verifying worker logic independently of the Spring context and Camunda test runtime.

What is the best way to write isolated unit tests for Camunda Zeebe microservices?

The best way to write isolated unit tests for Camunda Zeebe microservices is generating context-free tests that mock dependencies using mockk or Mockito. This mirrors worker file paths for test creation, satisfying requirements for rapid and reliable unit test scaffolding.

Does automated Zeebe worker test generation support both Java and Kotlin?

Yes, automated Zeebe worker test generation supports both Java and Kotlin. It utilizes Mockito for Java test creation and mockk for Kotlin, ensuring appropriate mocking frameworks are applied to scaffold tests for your specific microservice implementation.

Why do my Zeebe worker unit tests fail when running without the Camunda test runtime?

Zeebe worker unit tests fail without the Camunda test runtime if dependencies are not properly mocked. Generating context-free tests using mockk or Mockito isolates worker logic, preventing failures related to missing Spring context or Camunda runtime initialization.