test-worker
/test-worker
Writes the unit test for one job worker, JavaDelegate or external-task handler, covering inputs, outputs, BPMN errors and retries. Use when testing a worker or after create-worker.
- Author
- miragon ↗
- Repository
- bpmn-to-code ↗
- Licence
- MIT
- Last repository change
- 27.10.2026
Assessment and security
- Files in this package
- 9
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Writes the unit test for one job worker, JavaDelegate or external-task handler, covering inputs, outputs, BPMN errors and retries. Use when testing a worker or after create-worker.
Arguments
/test-worker <handler class or element id>
Original author description
Writes the unit test for one job worker, JavaDelegate or external-task handler, covering inputs, outputs, BPMN errors and retries. Use when testing a worker or after create-worker.
How it works
- IMPORTANT
- Step 1: Find the handler
- Step 2: Detect the stack
- Step 3: Cover these cases
- Step 4: Run it
SKILL.md preview
--- name: test-worker description: "Writes the unit test for one job worker, JavaDelegate or external-task handler, covering inputs, outputs, BPMN errors and retries. Use when testing a worker or after create-worker." argument-hint: "<handler class or element id>" allowed-tools: Read, Write, Edit, Glob, Grep, Bash(./gradlew *), Bash(mvn *), Bash(./mvnw *) --- # Skill: test-worker Test one inbound adapter in isolation. Mock the use case and the engine objects, and run no engine. The engine-specific test shape lives in `resources/`. ## IMPORTANT - Assert against the **generated names** (`FlowNodes.<Node>.Variables.X`, `Errors.X.code`), never against string literals. Then a model change breaks the test at compile time. - One test class per handler, next to it in the test source tree. - **Follow the project's existing test conventions first.** Fall back to the resource: - **Kotlin:** backtick names, `underTest`, MockK, `confirmVerified` - **Java:** `@DisplayName`, Mockito, `verifyNoMoreInteractions` ## Step 1: Find the handler Resolve `$ARGUMENTS` to the handler class. For an element id, find the class that references its `ServiceTasks` constant. Read the handler and its use case. ## Step 2: Detect the stack Pick the style from the handler's annotations and imports: | Handler uses | Style | |---|---| | `@ProcessEngineWorker` | `process-engine-api` | | `ExternalTaskHandler` / `@ExternalTaskSubscription` | `c7-external-task` | | `JavaDelegate` | `c7-delegate` | | `@JobWorker` | `zeebe` | Then read `resources/<style>-<kotlin|java>.md`, for example [resources/c7-delegate-kotlin.md](resources/c7-delegate-kotlin.md). ## Step 3: Cover these cases 1. **Happy path:** - the use case receives the domain values built from the input variables - every output variable is written under its generated name (or returned) - the task completes 2. **One test per BPMN error** the handler throws: the domain exception becomes `Errors.X.code`, and nothing is completed or written. 3. **Technical failure:** an unexpected exception is not swallowed. It reaches the engine as a retry or failure, the way the resource describes for this style. 4. No further interactions with the use case or the engine objects. Skip a case only if the handler has no such branch. ## Step 4: Run it Run only this test: `./gradlew test --tests '<TestClass>'` or `./mvnw test -Dtest=<TestClass>`. Fix the test, not the handler, unless the test exposes a real bug. If it does, report the bug.
Files in this package (9)
- SKILL.md 2 KB
- resources/c7-delegate-java.md 5 KB
- resources/c7-delegate-kotlin.md 4 KB
- resources/c7-external-task-java.md 4 KB
- resources/c7-external-task-kotlin.md 3 KB
- resources/process-engine-api-java.md 5 KB
- resources/process-engine-api-kotlin.md 4 KB
- resources/zeebe-java.md 6 KB
- resources/zeebe-kotlin.md 4 KB
Versions
The database has no other skills named test-worker.
Database snapshot: 13.11.2026 · package version 6b907efd8f09 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100create-worker
Implements one BPMN service task as a job worker, JavaDelegate or external-task handler that calls one use case, with names from the generated Process API. Use when a service task or job type needs code that handles it. - 90create-delegate
Create, update or test a JavaDelegate or an execution/task listener for a BPMN element on CIB seven (Camunda 7 fork), wired as a Spring @Component and invoked by expression (#{beanName}), together with its unit test and the process test of its path. Use when the user asks to… - 100create-delegate
Create, update or test a JavaDelegate or an execution/task listener for a BPMN element on Operaton (Camunda 7 fork), wired as a Spring @Component and invoked by expression (#{beanName}), together with its unit test and the process test of its path. Use when the user asks to… - 100test-process
Writes one process test that runs a BPMN scenario on a test engine and asserts the walked path as a typed ProcessPath. Use when testing a process path, a gateway branch, a boundary event or a timer. - 90relay-review
Relay Mode reviewer step. After the worker (Qwen Code, Kimi Code, Codex, or the Sonnet relay-worker) finishes a batch, checks every task's report, runs verify.ps1, checks each commit only touched allowed files, runs the full test suite, reviews code quality and security, then… - 90camunda-job-workers
Use this skill when writing the code behind an automated step of a BPMN process — a Java, Spring Boot, or TypeScript handler bound to a service task that completes the job, fails it, or throws a BPMN error — even if job workers aren't mentioned. Implements Camunda 8 job workers.…