test-worker
/test-worker
Pisze test jednostkowy dla jednego workera zadań BPMN: wejścia, wyjścia, błędy biznesowe i ponowienia.
- Autor
- miragon ↗
- Repozytorium
- bpmn-to-code ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 27.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 9
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Pisze test jednostkowy dla jednego workera zadań BPMN: wejścia, wyjścia, błędy biznesowe i ponowienia.
Argumenty
/test-worker <handler class or element id>
Oryginalny opis (EN)
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.
Jak działa
- IMPORTANT
- Step 1: Find the handler
- Step 2: Detect the stack
- Step 3: Cover these cases
- Step 4: Run it
Podgląd SKILL.md
--- 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.
Pliki w paczce (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
Wersje
W bazie nie ma innych skilli o nazwie test-worker.
Migawka bazy z 13.11.2026 · wersja paczki 6b907efd8f09 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100create-worker
Implementuje jedno zadanie usługowe BPMN jako job worker, JavaDelegate lub handler external-task wywołujący jeden przypadek użycia, z nazwami z wygenerowanego Process API. - 90create-delegate
Tworzy, aktualizuje i testuje JavaDelegate dla elementu BPMN w CIB seven, z wywołaniem przez port i testem procesu. - 100create-delegate
Tworzy, zmienia lub testuje delegata JavaDelegate albo słuchacza zadania dla elementu BPMN w Operaton, podłączonego jako komponent Spring, wraz z testami. - 100test-process
Pisze test procesu BPMN na silniku testowym: sprawdza przebytą ścieżkę jako typowany obiekt, również dla bramek, zdarzeń granicznych i timerów. - 90relay-review
Przegląda pracę workera po partii: raporty zadań, weryfikację, zakres zmienionych plików, testy, jakość i bezpieczeństwo, a potem wystawia uwagi do poprawy. - 90camunda-job-workers
Pisze kod obsługujący krok automatyczny w procesie BPMN w Camunda 8: handler w Javie, Spring Boot lub TypeScript, który kończy zadanie.