Appendix
Full reference for all factory methods exposed by PipeliteTest (accessible via import static io.pipelite.test.PipeliteTest.*), grouped by the phase of the given/when/then chain they belong to. See Introduction for the overall chain, Processor Testing, and Flow Testing for narrative examples of most of these.
Preconditions
Passed to given(Precondition…) and applied in order, before the component under test runs.
| Method | Description |
|---|---|
|
Adds a header to the initial exchange. |
|
Sets the input payload of the initial exchange. |
|
Registers a flow to be deployed in the test context (flow mode only). Multiple flows can be registered together and chained via |
|
Scans a |
|
Same as above, but resolves |
|
Overrides the default 5-second capture timeout used by |
Actions
Passed to when(Action); activates the component under test.
| Method | Description |
|---|---|
|
Executes the |
|
Starts a managed |
Expectations
Passed as varargs to then(Expectation…); all are evaluated, in order.
Processor-mode only
Require the processor’s outcome; using them after supplyTo(…) fails with a clear AssertionError.
| Method | Description |
|---|---|
|
Asserts the processor completed without throwing. |
|
Asserts the processor threw a |
|
Asserts the processor called |
|
Asserts the failure cause is exactly |
Flow-mode only
| Method | Description |
|---|---|
|
Asserts the flow reached its sink before the configured timeout. |
|
Asserts the flow did not reach its sink (e.g. it was filtered or stopped along the way). |
Exchange-level (both modes)
| Method | Description |
|---|---|
|
Asserts the effective payload — output if set, otherwise input — equals |
|
Asserts the named header is present. |
|
Asserts the named header is present and equal to |
|
Asserts the named header is absent. |
|
Asserts the payload is of type |
Grouping: output vs. step
| Method | Description |
|---|---|
|
Groups expectations that apply to the final exchange. Purely a readability label when mixed with |
|
Verifies |
|
Same as above, but pinned to |
Custom expectations
Any lambda matching (ExchangeImpl exchange, TestProcessContribution contribution) → void is a valid Expectation; throw AssertionError yourself to signal failure:
.then((exchange, contribution) -> {
String payload = (String) exchange.getInputPayload();
if (!payload.startsWith("OK:")) {
throw new AssertionError("Expected payload to start with 'OK:', got: " + payload);
}
});
contribution is null in flow mode — check before accessing it.
ThenOperations — direct access
Returned by when(…); in addition to then(…), it exposes the result directly for use with an external assertion library:
| Method | Description |
|---|---|
|
Returns the effective payload (output if set, otherwise input). Throws |
|
Returns the effective payload cast to |
|
Returns the header value cast to |