> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streemlined.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Interactive Testing

> Interactive testing during development with stubbed sources and sinks

Test Run mode transforms your pipeline into an interactive testing environment where you can push data, observe transformations, and understand exactly what's happening at every step.

## How It Works

When you start a Test Run:

1. **Source and Sink nodes become stubs** — Instead of connecting to real Kafka topics or databases, they become interactive endpoints
2. **The pipeline runs synchronously** — Data flows through immediately, making it easy to follow
3. **Every node tracks inputs and outputs** — You can inspect what each node received and produced

<Frame>
  <img src="https://mintcdn.com/streemlined/uXEQZklUEoFXCoaE/images/test-run-mode.png?fit=max&auto=format&n=uXEQZklUEoFXCoaE&q=85&s=f11c45874d5a97b2cd9f0af686b34e22" alt="Test Run Mode Interface" width="1953" height="906" data-path="images/test-run-mode.png" />
</Frame>

## Starting a Test Run

1. Click the **Test Run** button in the toolbar (or use the dropdown next to Play)
2. The pipeline enters test mode — you'll see stub indicators on source and sink nodes
3. Source nodes display an input area where you can push JSON messages

## Pushing Test Data

With Test Run active, each source node shows a JSON input panel:

```json theme={null}
{
  "id": 123,
  "customer": {
    "name": "Alice Johnson",
    "email": "alice@example.com"
  },
  "items": [
    {"sku": "WIDGET-01", "price": 29.99, "qty": 2},
    {"sku": "GADGET-05", "price": 49.99, "qty": 1}
  ]
}
```

Click **Send** to push the message through the pipeline.

## Inspecting Node I/O

After sending a message, every node displays its input and output data:

| Node                      | Input              | Output                    |
| ------------------------- | ------------------ | ------------------------- |
| **Kafka Consumer (stub)** | —                  | Your test JSON            |
| **Transform**             | Raw order          | Transformed record        |
| **Branch**                | Transformed record | Routed to matching output |
| **JDBC Sink (stub)**      | Final record       | —                         |

<Tip>
  Click on any node to expand its I/O panel and see the full JSON payload. This is invaluable for debugging complex transformations.
</Tip>

## Sink Stub Behavior

Sink nodes in Test Run mode:

* Display all records they would have written
* Show the exact payload that would go to Kafka, databases, or external systems
* Allow you to verify output format before connecting to real systems

## Selective Stubbing

By default, all sources and sinks are stubbed during a Test Run. You can toggle individual nodes between **stubbed** and **connected** to mix real integrations with test endpoints.

Mouse over any source or sink node to make the stub indicator appear:

* <Icon icon="plug-circle-xmark" /> **Stubbed** — the node behaves as an interactive test endpoint (default)
* <Icon icon="plug" /> **Connected** — the node connects to its real Kafka topic or database

<Frame>
  <img src="https://mintcdn.com/streemlined/qpLccCzAPOQG7FVs/images/test-mode-connected-disconnected.png?fit=max&auto=format&n=qpLccCzAPOQG7FVs&q=85&s=2e1d96d47ec507c9f8d14f8a3770d286" alt="Test Run Mode Interface" width="298" height="384" data-path="images/test-mode-connected-disconnected.png" />
</Frame>

This lets you test parts of the pipeline against real systems while keeping the rest under your control. For example, you can connect a source to a live Kafka topic but stub the sink to safely inspect what would be written, or connect the sink to a real database while pushing synthetic data from a stubbed source.

<Frame>
  <img src="https://mintcdn.com/streemlined/qpLccCzAPOQG7FVs/images/test-run-mode-selective.png?fit=max&auto=format&n=qpLccCzAPOQG7FVs&q=85&s=102122bfb041764ca609f0c54e2f4544" alt="Test Run Mode Interface" width="1945" height="1058" data-path="images/test-run-mode-selective.png" />
</Frame>

<Tip>
  Selective stubbing is especially useful for validating integration boundaries without committing to a full end-to-end run.
</Tip>

## Benefits

<CardGroup cols={2}>
  <Card title="No External Dependencies" icon="plug-circle-xmark">
    Test without Kafka, databases, or other systems running
  </Card>

  <Card title="Instant Feedback" icon="bolt">
    See results immediately as data flows synchronously
  </Card>

  <Card title="Full Visibility" icon="eye">
    Inspect every transformation step with detailed I/O logs
  </Card>

  <Card title="Safe Iteration" icon="shield">
    Experiment freely without affecting real data
  </Card>
</CardGroup>

## Best Practices

<AccordionGroup>
  <Accordion title="Use Test Run during development">
    Use Test Run mode to interactively build and debug your transformations. Once you're confident in the logic, codify the scenarios as Pipeline Tests for CI/CD.
  </Accordion>

  <Accordion title="Test edge cases interactively">
    Try various inputs including:

    * Empty arrays and null values
    * Missing optional fields
    * Boundary conditions (e.g., exactly at threshold values)
    * Invalid data that should be rejected
  </Accordion>

  <Accordion title="Verify branch routing">
    For pipelines with Branch nodes, test messages that should route to each output to ensure your conditions work as expected.
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Pipeline Tests" icon="vial" href="/pipeline-tests">
    Automate testing with YAML test definitions
  </Card>

  <Card title="Deploy Pipelines" icon="rocket" href="/deployment">
    Deploy your tested pipeline to production
  </Card>
</CardGroup>
