# evidence 261 — messaging-documentation-contract-test-coverage
# revision: a24ece9cf797f7ea647e33bf846b115208ed1ba5
# cwd: /shared/codebase/clean-architecture-backend-template/src/messaging
# command: grep -n "void " messaging-testkit/src/test/java/dev/caskeleton/messaging/testkit/MessagingDocumentationContractTest.java; echo; echo ---class javadoc---; sed -n "1,25p" messaging-testkit/src/test/java/dev/caskeleton/messaging/testkit/MessagingDocumentationContractTest.java; echo; echo ---the two weakest assertions---; sed -n "113,133p" messaging-testkit/src/test/java/dev/caskeleton/messaging/testkit/MessagingDocumentationContractTest.java
# ---- raw output ----
43:  void everyDocumentTheSupportMatrixPromisesExists() {
61:  void theSupportMatrixNamesExactlyTheAdaptersTheCodeCallsStable() {
70:  void theSupportMatrixDoesNotCallAnExperimentalAdapterStable() {
83:  void theDocumentedKafkaVersionsMatchWhatTheCodeCertifies() {
92:  void theUnsupportedListStillNamesTheTwoConstantsThatDoNotExist() {
102:  void noEnumConstantTheDocsDenyActuallyExists() {
115:  void theExperimentalPolicyStatesThatExperimentalIsOffByDefault() {
120:  void everyDocumentHasContent() {

---class javadoc---
package dev.caskeleton.messaging.testkit;

import static org.assertj.core.api.Assertions.assertThat;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import org.junit.jupiter.api.Test;

/**
 * Checks that the shipped documentation still describes the code.
 *
 * <p>Docs rot silently. A support matrix claiming an adapter is Stable outlives the day someone
 * demoted it, and nothing fails — the tests still pass, the build is green, and the only signal is
 * an operator making a decision on a page that stopped being true months ago.
 *
 * <p>The assertions are deliberately narrow: they check the claims a reader would act on, not
 * prose. Asserting on wording would make every edit a test failure and the check would be deleted.
 */
class MessagingDocumentationContractTest {

  private static Path docsRoot() {
    Path candidate = Path.of("").toAbsolutePath();
    while (candidate != null && !Files.isDirectory(candidate.resolve("docs/messaging"))) {

---the two weakest assertions---

  @Test
  void theExperimentalPolicyStatesThatExperimentalIsOffByDefault() {
    assertThat(read("experimental-policy.md")).contains("false");
  }

  @Test
  void everyDocumentHasContent() {
    assertThat(
            List.of(
                "support-matrix.md",
                "delivery-guarantees.md",
                "retry-dlq-redrive.md",
                "outbox-inbox.md",
                "security.md",
                "operations.md",
                "configuration-reference.md",
                "experimental-policy.md",
                "migration-guide.md"))
        .allSatisfy(name -> assertThat(read(name).length()).isGreaterThan(500));
  }
