Skip to content
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docs/apis-tools/testing/assertions.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,42 @@ assertThat(processInstance).hasLocalVariableSatisfies(
});
```

### hasVariableSatisfiesJudge

Assert that a process variable satisfies a natural language expectation using a configured LLM judge. The assertion
fails if the LLM score is below the configured threshold (default: 0.5). Requires [judge configuration](configuration.md#judge-configuration).

```java
assertThat(processInstance)
.hasVariableSatisfiesJudge("result", "Contains a valid JSON response with status OK.");
```

### hasLocalVariableSatisfiesJudge

Assert that a local variable in the scope of a given element satisfies a natural language expectation. Use the BPMN
element ID or an [element selector](utilities.md#element-selector) to identify the element.

```java
assertThat(processInstance)
.hasLocalVariableSatisfiesJudge(
ElementSelectors.byName("Greet Customer"), "output",
"Contains a polite greeting addressed to the customer.");
```

### withJudgeConfig

Override the global judge configuration for a single assertion chain.

```java
assertThat(processInstance)
.withJudgeConfig(config -> config.withThreshold(0.9))
.hasVariableSatisfiesJudge("result", "Contains a valid JSON response with status OK.");
```

:::tip
For a complete walkthrough of testing agentic processes with judge assertions and conditional behavior, see [Testing agentic processes](testing-agentic-processes.md).
:::

## Process instance message assertions

You can verify the message subscriptions of a process instance using `CamundaAssert.assertThat(processInstance)`.
Expand Down
344 changes: 344 additions & 0 deletions docs/apis-tools/testing/configuration.md

Large diffs are not rendered by default.

Loading
Loading