Merge commit '4b37f8fd05804d2d76e11cec1afce52919f2eb59' into work/projects

This commit is contained in:
sechmachine
2026-08-14 23:32:54 +07:00
13 changed files with 1349 additions and 0 deletions
@@ -0,0 +1,78 @@
# Test Evidence: Platform foundation
- **Test type:** Integration
- **Requirement IDs:** `ARC-001ARC-008, DB-003DB-012, OPS-003, TST-001TST-010`
- **Scenario IDs:** `AC-DB-001, AC-OPS-002, AC-TST-001`
- **Test class/method:** `com.lab.labtimesheet.PlatformFoundationTest`
- **Implementation commit:** `this milestone commit`
## Protected behavior
The application starts with the six required package boundaries, Flyway creates the approved 23-table/56-foreign-key PostgreSQL catalog and seed, and tests receive deterministic time without a developer database.
## Test method
A full Spring context starts against a PostgreSQL 18.4 Testcontainer. JDBC catalog queries independently count application tables and foreign keys and inspect the seed. Class loading checks the declared package boundaries, and the injected test `Clock` is asserted exactly.
## Hand-derived expected result
The approved DDL catalog contains 23 application tables and 56 foreign keys. The seed has checkout grace 30 and five MondayFriday rows. Test time is `2026-08-14T00:00:00Z` in `Asia/Ho_Chi_Minh`.
## RED
**Command**
```text
export JAVA_HOME=/opt/homebrew/opt/openjdk@25
export PATH="$JAVA_HOME/bin:/opt/homebrew/opt/node@24/bin:$PATH"
export DOCKER_HOST=unix:///Users/sechmachine/.orbstack/run/docker.sock
./mvnw -Dtest=PlatformFoundationTest test
```
**Observed result**
```text
Tests run: 3, Failures: 1, Errors: 1, Skipped: 0
PlatformFoundationTest.flywayCreatesApprovedPostgresCatalog: expected: 23 but was: 0
PlatformFoundationTest.applicationExposesRequiredModulePackages: ClassNotFound com.lab.labtimesheet.accounts.package-info
BUILD FAILURE
```
Flyway reported zero migrations and the first required boundary class was absent, so the failure was caused by the missing foundation.
## GREEN
**Command**
```text
export JAVA_HOME=/opt/homebrew/opt/openjdk@25
export PATH="$JAVA_HOME/bin:/opt/homebrew/opt/node@24/bin:$PATH"
export DOCKER_HOST=unix:///Users/sechmachine/.orbstack/run/docker.sock
./mvnw -Dtest=PlatformFoundationTest test
```
**Observed result**
```text
Successfully applied 1 migration to schema "public", now at version v1
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS
```
## Affected suite
**Command and result**
```text
export JAVA_HOME=/opt/homebrew/opt/openjdk@25
export PATH="$JAVA_HOME/bin:/opt/homebrew/opt/node@24/bin:$PATH"
export DOCKER_HOST=unix:///Users/sechmachine/.orbstack/run/docker.sock
./mvnw test
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS
```
## External-test boundaries
This proves migration replay and catalog shape on an ephemeral local PostgreSQL 18.4 container. It does not prove application container, Compose, CI, external SMTP, browser, publication, or deployment behavior; those boundaries are deferred or owned elsewhere.