> For the complete documentation index, see [llms.txt](https://host2host.onibonje.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://host2host.onibonje.com/docs/35-testing-strategy.md).

# Testing Strategy

## 1. Overview

Platform-wide testing approach before and after implementation. Complements per-module tests in [Modular JAR Architecture](/docs/03-modular-jar-architecture.md).

***

## 2. Test Pyramid

```mermaid
flowchart TB
  E2E[E2E Partner Scenarios]
  INT[Integration Testcontainers]
  CONTRACT[Contract Tests]
  ROUTE[Camel Route Tests]
  UNIT[Unit Tests]

  E2E --> INT --> CONTRACT --> ROUTE --> UNIT
```

| Layer       | % effort | Tools                                   |
| ----------- | -------- | --------------------------------------- |
| Unit        | 50%      | JUnit 5, Mockito                        |
| Route       | 20%      | Camel Test Kit                          |
| Contract    | 10%      | Spring Cloud Contract                   |
| Integration | 15%      | Testcontainers (PG, Kafka, SFTP, Vault) |
| E2E         | 5%       | Sandbox partners, Cucumber              |

***

## 3. Test Environments

| Env     | Finacle               | Purpose         |
| ------- | --------------------- | --------------- |
| Local   | Mock                  | Developer       |
| CI      | Mock + Testcontainers | Pipeline        |
| Sandbox | Finacle sandbox       | Partner UAT     |
| UAT     | Finacle UAT           | Bank acceptance |
| Prod    | Production            | Smoke only      |

***

## 4. Critical Test Scenarios

| ID    | Scenario                       |
| ----- | ------------------------------ |
| TS-01 | Bulk SFTP payment STP          |
| TS-02 | API payment idempotency        |
| TS-03 | Duplicate file rejection       |
| TS-04 | PGP encrypt/decrypt round-trip |
| TS-05 | Config publish without restart |
| TS-06 | Event subscription webhook     |
| TS-07 | Finacle timeout retry          |
| TS-08 | Partial batch ACK              |
| TS-09 | Signed URL upload/download     |
| TS-10 | Multi-country profile merge    |

***

## 5. Architecture Tests

ArchUnit rules:

* No partner ID literals in route modules
* Route modules depend on `h2h-core-banking-api` only — not `h2h-finacle-wrapper` internals
* No vendor DB driver imports outside `h2h-persistence-spi` / `h2h-config-store`
* No Finacle SDK outside `h2h-finacle-wrapper`
* No secrets in config store entities

Route tests use `MockCoreBankingIntegration` implementing `CoreBankingIntegration`.

***

## 6. Performance Tests

See [Performance and Capacity](/docs/32-performance-and-capacity.md) — Gatling gates before go-live.

***

## 7. Partner UAT

Partner onboarding includes mandatory sandbox test checklist in [Partner Portal](/docs/37-partner-portal.md).

***

## 8. Related Documents

* [33 DevSecOps Pipeline](/docs/33-devsecops-pipeline.md)
* [22 Use Cases](/docs/22-use-cases-and-solutions.md)
* [05 Low-Code Admin Platform](/docs/05-low-code-admin-platform.md) test harness


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://host2host.onibonje.com/docs/35-testing-strategy.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
