You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: Rename underscore IT tests and complete plan checklist
Bring all tests in OpenApiServerIT into pure-camelCase form, matching
the project convention applied on feat/combinators. Also flip the
remaining final-verification items in the schema-booleans plan to [x]
now that the branch is verified end to end.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Open `src/main/java/com/retailsvc/http/spec/schema/Schema.java`. Add `AlwaysSchema` and `NeverSchema` to the `permits` list. The full list becomes (alphabetized as in the existing file):
66
66
@@ -88,7 +88,7 @@ public sealed interface Schema
88
88
89
89
### Step 1.2: Add failing parser tests
90
90
91
-
-[]**Step 4: Append parser tests**
91
+
-[x]**Step 4: Append parser tests**
92
92
93
93
Append to `src/test/java/com/retailsvc/http/spec/schema/SchemaParserTest.java` (inside the class, before the final `}`):
The `assertThatThrownBy` static is not yet imported — leave the fully-qualified call in place; it lives only in this single test and matches the pattern used elsewhere in the codebase before that import was added in `feat/combinators`.
135
135
136
-
-[]**Step 5: Run the failing tests**
136
+
-[x]**Step 5: Run the failing tests**
137
137
138
138
Run: `mvn -q test -Dtest=SchemaParserTest`
139
139
@@ -143,7 +143,7 @@ Expected: the build fails to compile. The new tests call `SchemaParser.parse(Boo
143
143
144
144
### Step 1.3: Change the parser entry to accept `Object`
Open `src/main/java/com/retailsvc/http/spec/schema/SchemaParser.java`. Replace the public `parse(Map<String, Object>)` method with a new `parse(Object)` entry, and rename the original body to a private `parseMap(...)`. Concretely:
### Step 1.4: Drop `Map` casts on external `parse` callers in `Spec.java`
235
235
236
-
- [] **Step 7: Edit `Spec.java`**
236
+
- [x] **Step 7: Edit `Spec.java`**
237
237
238
238
Open `src/main/java/com/retailsvc/http/spec/Spec.java`. Drop the `(Map<String, Object>)` cast on the four direct `SchemaParser.parse(...)` callers. The lines (in current commit):
239
239
@@ -253,19 +253,19 @@ The four `@SuppressWarnings("unchecked")` annotations on the surrounding methods
253
253
254
254
### Step 1.5: Verify and commit
255
255
256
-
- [] **Step 8: Run the parser tests**
256
+
- [x] **Step 8: Run the parser tests**
257
257
258
258
Run: `mvn -q test -Dtest=SchemaParserTest`
259
259
260
260
Expected: all parser tests pass (existing + the 5 new).
261
261
262
-
- [] **Step 9: Run the full unit suite**
262
+
- [x] **Step 9: Run the full unit suite**
263
263
264
264
Run: `mvn -q test`
265
265
266
266
Expected: BUILD SUCCESS. No regressions in `Spec`-driven tests, validator tests, or container tests.
If `Map` isn't already imported (it likely is for surrounding tests), add `import java.util.Map;` next to other `java.util.*` imports.
367
367
368
-
- [] **Step2:Run the failing tests**
368
+
- [x] **Step2:Run the failing tests**
369
369
370
370
Run: `mvn -q test -Dtest=DefaultValidatorDispatchTest`
371
371
372
372
Expected:7new tests fail. The validator currently has no case for `AlwaysSchema` or `NeverSchema`, so the sealed `switch` is non-exhaustive and the file no longer compiles. (Recall that Java's exhaustive switch on a sealed type requires all permitted subtypes to be covered.) Compilation will fail with "switch expression does not cover all possible input values" — that's the expected red state forTDD here.
Open `src/main/java/com/retailsvc/http/validate/DefaultValidator.java`.Inside the `switch (schema)` block in `validate(...)`, add two new cases. Place them adjacent to the other "trivial" cases (after `BooleanSchema`/`NullSchema`, before the primitive cases — the exact ordering doesn't matter, but stay consistent with the file's existing case order):
@@ -432,7 +432,7 @@ Pre-commit hook may reformat — re-stage / re-run as needed.
432
432
433
433
### Step3.1:Extend the OpenAPI fixture
434
434
435
-
- [] **Step1:Add `/gates` to `openapi.yaml`**
435
+
- [x] **Step1:Add `/gates` to `openapi.yaml`**
436
436
437
437
Open `src/test/resources/openapi.yaml`.After the existing `/blocked` (or `/shapes` if `/blocked` doesn't exist on this branch — see note below) endpoint, add:
438
438
@@ -457,7 +457,7 @@ Open `src/test/resources/openapi.yaml`. After the existing `/blocked` (or `/shap
457
457
458
458
**Note about base branch.** This branch (`feat/schema-booleans`) is cut from `master`, which does NOT have `/shapes`, `/filters`, or `/blocked` (those live on `feat/combinators`). The fixture on this branch instead has stub `/anyOf` and `/allOf` paths with `post: {}`. Add `/gates` after `/anyOf` and `/allOf` to keep the surrounding ordering predictable. Do NOT remove the `/anyOf` / `/allOf` stubs — that cleanup is owned by `feat/combinators`.
459
459
460
-
- [] **Step 2: Mirror in `openapi.json`**
460
+
- [x] **Step 2: Mirror in `openapi.json`**
461
461
462
462
Open `src/test/resources/openapi.json`. Find the `"/anyOf"` and `"/allOf"` keys. Add `"/gates"` immediately after them. The block:
463
463
@@ -489,7 +489,7 @@ Mind the trailing commas: the previous path entry needs a trailing comma if it d
Open `src/test/java/com/retailsvc/http/OpenApiServerIT.java`. Add a new nested classat the bottom of the outer class (immediately before its final `}`).All test method names are pure camelCase per the project convention:
495
495
@@ -546,13 +546,13 @@ class Gates {
546
546
547
547
### Step 3.3: Verify and commit
548
548
549
-
- [] **Step4:Run the verify build**
549
+
- [x] **Step4:Run the verify build**
550
550
551
551
Run: `mvn -q verify`
552
552
553
553
Expected:BUILDSUCCESS. The two new IT methods pass alongside everything else.
@@ -577,9 +577,9 @@ Pre-commit hook may reformat YAML / Java — re-stage / re-run as needed.
577
577
578
578
## Final verification
579
579
580
-
- [] Run `mvn -q verify` once more.
581
-
- [] `git log --oneline master..HEAD` shows the spec commit followed by three feature commits in this order: `feat:Parseboolean schemas…`, `feat:ValidateAlwaysSchema and NeverSchema…`, `test:Add integration coverage forboolean schemas…`.
582
-
- [] `grep -rEn "void [a-zA-Z][a-zA-Z0-9]*_[a-zA-Z]" src/test/java/` returns nothing — confirms test method names follow the pure-camelCase convention.
580
+
- [x] Run `mvn -q verify` once more.
581
+
- [x] `git log --oneline master..HEAD` shows the spec commit followed by three feature commits in this order: `feat:Parseboolean schemas…`, `feat:ValidateAlwaysSchema and NeverSchema…`, `test:Add integration coverage forboolean schemas…`.
582
+
- [x] `grep -rEn "void [a-zA-Z][a-zA-Z0-9]*_[a-zA-Z]" src/test/java/` returns nothing — confirms test method names follow the pure-camelCase convention.
0 commit comments