# Integration Test Plan

## Integration Point: {component A} <-> {component B}

### Test Scenario: {scenario_name}

- **Components Involved**: {list of components/services being tested together}
- **Description**: {what interaction this test verifies}

#### Setup Requirements
- {Database seeded with: specific test data}
- {Service X running on: port/URL}
- {Environment variable: VALUE}
- {External service mock: configured to return...}

#### Test Steps
1. {Action}: {what to do}
   - **Expected**: {what should happen}
2. {Action}: {what to do}
   - **Expected**: {what should happen}
3. {Verify}: {what to check}
   - **Expected**: {the final state or response}

#### Expected Behavior
- {Component A sends X to Component B}
- {Component B responds with Y}
- {Database state after: describe expected records}

#### Error Scenarios
- **{Component B is unavailable}**: {expected behavior — retry, fallback, error response}
- **{Invalid data from Component A}**: {expected behavior — validation error, rejection}
- **{Timeout}**: {expected behavior — timeout handling, circuit breaker}

#### Cleanup
- {Delete test records from database}
- {Reset external service mocks}
- {Restore original configuration}

---

### Test Scenario: {next_scenario_name}

- **Components Involved**: {list}
- **Description**: {what this tests}

#### Setup Requirements
- {list setup needs}

#### Test Steps
1. {step}
2. {step}

#### Expected Behavior
- {expected outcome}

#### Cleanup
- {cleanup steps}

---

## Integration Matrix

| Component A | Component B | Scenarios | Status |
|------------|------------|-----------|--------|
| {API} | {Database} | {count} | Planned |
| {API} | {Auth Service} | {count} | Planned |
| {Worker} | {Queue} | {count} | Planned |

## Test Summary

| Integration Point | Happy Path | Error Handling | Timeout/Retry | Total |
|------------------|-----------|---------------|---------------|-------|
| {point} | {count} | {count} | {count} | {count} |
| **Total** | {count} | {count} | {count} | {count} |
