saga-full — testing strategy

Four layers, run together — each blind to a different failure mode.

compileJava/assemble/bootJar succeeding proves nothing about whether a module actually starts, wires into Spring, or survives a real wire round trip. Every suite in this repo is deliberately broken and re-run to confirm it actually catches bad data, before being trusted — assumed-correct-but-never-run is treated as untested here.

contextLoads()

Context boot@SpringBootTest, written first for every module

Proves
A real ApplicationContext actually starts — component scan, JPA/Hikari, the gRPC server — under this repo's actual JDK.
Blind to
Zero business logic exercised — a module can boot cleanly while every real code path is broken.
Caught it: Spring Boot 3.4.1 couldn't boot at all under JDK 25 — Spring's own bundled ASM can't parse the class files. Neither Boot module had ever proven real startup before this test existed.
Mockito + real ObjectMapper

Unit, mocked collaboratorsservice-layer business logic

Proves
Branching, idempotency guards, JSON round-trips — and that generated protobuf/gRPC classes actually construct at runtime, not just compile.
Blind to
Never sends a message over the wire — serialization and gRPC Status codes aren't proven here.
Caught it: spring-grpc's BOM silently downgraded protobuf-java below what generated code needs, on the real runtime classpath — invisible until this layer first built a message object.
@DataJpaTest

Repositoryembedded H2, real Hibernate DDL

Proves
Query correctness against a real schema — ordering, existsBy* guards, the outbox's SKIP LOCKED query actually compiles and runs.
Blind to
H2's Postgres compatibility mode, not the real dialect — and single-threaded, not real concurrent access.
Untested edge, acknowledged: SKIP LOCKED's concurrent-safety guarantee has never been exercised under genuinely concurrent transactions — trusted as documented Hibernate/Postgres behavior, not independently proven here.
InProcess gRPC + real Docker infra

Wire / integrationreal (de)serialization, real Postgres + Kafka

Proves
Messages and Status codes survive real serialization; a genuine HikariPool→PgConnection and Kafka consumer groups getting real partition assignments against a live broker.
Blind to
Nothing structurally — but it only covers the specific scenarios actually run against the local Docker stack.
Caught it: grpc-inprocess was already on testRuntimeClasspath (transitive) but absent from testCompileClasspath — a real compile-vs-runtime dependency-scope gap this layer surfaced.

All four run together: a booting context plus mocked-unit-correct still doesn't prove a message survives the wire, and a passing repository test still doesn't prove the module starts at all. Full per-tool JDK-25 gotchas (Lombok, Mockito/ByteBuddy, Spring's own ASM) are catalogued on the wiki.