Item Supply - Unit Test Coverage Map
Item Supply - Unit Test Coverage Map
This document maps requirements from requirements.md to their corresponding unit tests as defined in the task files under workspace/projects/mvp2/5-item-supply-updates-services.
Coverage Summary
| Category |
Requirements |
Covered |
Status |
| Entity (EM) |
2 |
2 |
✅ |
| Method (MM) |
7 |
7 |
✅ |
| Persistence (PC) |
1 |
1 |
✅ |
| API (AC) |
2 |
2 |
✅ |
| Validation (VR) |
6 |
6 |
✅ |
| Total |
18 |
18 |
✅ |
Entity Requirements
| Req ID |
Requirement Title |
Task |
Test IDs |
Test File |
| EM-ISU-001 |
ItemSupplyReference Properties |
N/A |
(Covered via MM) |
Various |
| EM-ISU-002 |
ItemSupply Entity |
N/A |
(Covered via MM) |
ItemSupplyServiceTest.kt |
Note: Entity requirements are implicitly validated through method tests that create, update, and query these entities.
Method Requirements
| Req ID |
Requirement Title |
Task |
Test IDs |
| MM-ISU-001 |
Item Creation with Qualifier |
5-1 |
T-001 to T-005, T-007, T-009, T-010, T-026-029 |
| MM-ISU-002 |
Item Update with Qualifier |
5-2 |
T-006, T-008, T-201 to T-210 |
| MM-ISU-003 |
Item Deletion |
5-1 |
T-011, T-012, T-013, T-014 |
| MM-ISU-004 |
Create ItemSupply |
5-1, 5-3 |
T-002, T-015 to T-018, T-301 to T-309 |
| MM-ISU-005 |
Update ItemSupply |
Existing |
T-019, T-020 |
| MM-ISU-006 |
Remove ItemSupply |
5-1 |
T-021, T-022 |
| MM-ISU-007 |
List Supplies |
Existing |
T-016, T-023 |
Persistence Requirements
| Req ID |
Requirement Title |
Task |
Test IDs |
Test File |
Source |
| PC-ISU-001 |
ItemSupply Table Schema |
N/A |
(Integration/DB) |
DB migrations are tested via Flyway |
N/A |
Note: Persistence requirements are validated through database migration tests and integration tests that exercise the full CRUD cycle.
API Requirements
| Req ID |
Requirement Title |
Task |
Test IDs |
Test Type |
| AC-ISU-001 |
Qualifier Parameter |
5-1 |
AT-ISU-001 |
API / Integration |
| AC-ISU-002 |
ItemSupply CRUD Endpoints |
Existing |
AT-ISU-002-006 |
API / Integration |
Note: API requirements are primarily validated through Bruno API tests rather than unit tests.
Validation Rules
| Req ID |
Requirement Title |
Task |
Test IDs |
Test File |
| VR-ISU-001 |
Name Required |
Existing |
T-024 |
ItemSupplyServiceTest.kt |
| VR-ISU-002 |
Supplier Required |
Existing |
T-024, T-025 |
ItemSupplyServiceTest.kt |
| VR-ISU-003 |
Name Uniqueness |
5-2 |
T-017, T-211-213 |
ItemSupplyServiceTest.kt |
| VR-ISU-004 |
URL Required for Online |
Existing |
(Implicit) |
ItemSupplyServiceTest.kt |
| VR-ISU-005 |
Order Quantity Positive |
Existing |
(Implicit) |
Validation tests |
| VR-ISU-006 |
Unit Cost Non-Negative |
Existing |
(Implicit) |
Validation tests |
Detailed Test Mapping by Task
Priority 1: Breaking Behaviors (5-1)
| Test ID |
Test Name |
Requirement |
Status |
| T-001 |
LAX: Create Item with missing supply IDs succeeds |
MM-ISU-001 |
Existing |
| T-002 |
LAX: Create Supply that already exists performs upsert |
MM-ISU-004 |
Existing |
| T-003 |
STRICT: Create with non-existent supplyEId fails |
MM-ISU-001 |
Existing |
| T-004 |
STRICT: Create with supply reference creates ItemSupply |
MM-ISU-001 |
Modified |
| T-005 |
STRICT: Create fails when supply name doesn’t match DB |
MM-ISU-001 |
Existing |
| T-006 |
STRICT: Update fails when supplier doesn’t match DB |
MM-ISU-002 |
Existing |
| T-007 |
PROPAGATE: Create Item with new supply creates automatically |
MM-ISU-001 |
Existing |
| T-008 |
PROPAGATE: Update with changed supply fields updates record |
MM-ISU-002 |
Existing |
| T-011 |
Delete Item with no supplies succeeds |
MM-ISU-003 |
New |
| T-012 |
Delete Item with one supply deletes both |
MM-ISU-003 |
New |
| T-013 |
Delete Item with multiple supplies deletes all |
MM-ISU-003 |
New |
| T-014 |
Verify no orphaned ItemSupply after deletion |
MM-ISU-003 |
New |
| T-021 |
Remove supply fails when referenced by primarySupply |
MM-ISU-006 |
New |
| T-022 |
Remove supply succeeds when not referenced |
MM-ISU-006 |
New |
Priority 2: Data Integrity (5-2)
| Test ID |
Test Name |
Requirement |
Status |
| T-201 |
Update with supplyEId enriches name and supplier from ItemSupply |
MM-ISU-002 |
New |
| T-202 |
Update with name auto-populates supplyEId from match |
MM-ISU-002 |
New |
| T-203 |
Update with unmatched name keeps supplyEId null |
MM-ISU-002 |
New |
| T-204 |
Update with neither supplyEId nor name defaults name from supplier |
MM-ISU-002 |
New |
| T-205 |
Update preserves user-provided values over defaults |
MM-ISU-002 |
New |
| T-206 |
LAX update with matching ItemSupply and consistent values succeeds |
MM-ISU-002 |
New |
| T-207 |
LAX update with matching ItemSupply but different supplier fails |
MM-ISU-002 |
New |
| T-208 |
LAX update with matching ItemSupply but different sku fails |
MM-ISU-002 |
New |
| T-209 |
LAX update with no matching ItemSupply succeeds (one-off) |
MM-ISU-002 |
New |
| T-210 |
LAX update preserves values when ItemSupply doesn’t exist |
MM-ISU-002 |
New |
| T-211 |
ItemSupply name uniqueness enforced within parent |
VR-ISU-003 |
Existing |
| T-212 |
Same name with different supplier fails (Option B) |
VR-ISU-003 |
Pending |
| T-213 |
Same name with different supplier succeeds (Option A) |
VR-ISU-003 |
Pending |
Priority 3: Completeness (5-3)
| Test ID |
Test Name |
Requirement |
Status |
| T-301 |
Create ItemSupply with explicit supplierEId preserves value |
Task 3.1 |
New |
| T-302 |
Create ItemSupply without supplierEId auto-resolves from vendor name |
Task 3.1 |
New |
| T-303 |
Update ItemSupply with new supplierEId persists change |
Task 3.1 |
New |
| T-304 |
Create ItemSupply with invalid supplierEId handles error |
Task 3.1 |
New |
| T-305 |
Create ItemSupply backfills matching primarySupply null fields |
Task 3.2 |
New |
| T-306 |
Create ItemSupply backfills matching secondarySupply null fields |
Task 3.2 |
New |
| T-307 |
Create ItemSupply with no matching reference does not modify parent |
Task 3.2 |
New |
| T-308 |
Create ItemSupply in PROPAGATE mode does not trigger backfill |
Task 3.2 |
New |
| T-309 |
Backfill preserves non-null values in supply reference |
Task 3.2 |
New |
| T-310 |
Add Item with legacy operation (LAX) - casing fix |
Task 3.3 |
Modify |
| T-311 |
Add Item with UPDATE qualifier (PROPAGATE) - casing fix |
Task 3.3 |
Modify |
Test Files Summary
| Test File |
Location |
Requirements Covered |
ItemMutationQualifierIntentTest.kt |
/../operations/src/test/kotlin/cards/arda/operations/reference/item/service/ |
MM-ISU-001, MM-ISU-002 |
AddItemWithSuppliesTest.kt |
/../operations/src/test/kotlin/cards/arda/operations/reference/item/service/ |
MM-ISU-001, Task 3.3 |
ItemSupplyServiceTest.kt |
/../operations/src/test/kotlin/cards/arda/operations/reference/item/service/ |
MM-ISU-004-007, VR-ISU-001-003 |
ItemServiceValidationTest.kt |
/../operations/src/test/kotlin/cards/arda/operations/reference/item/service/ |
MM-ISU-001 |
ItemServiceDeleteTest.kt |
/../operations/src/test/kotlin/cards/arda/operations/reference/item/service/ |
MM-ISU-003 |
ItemServiceEnrichmentTest.kt |
/../operations/src/test/kotlin/cards/arda/operations/reference/item/service/ |
MM-ISU-002 |
ItemServiceLaxValidationTest.kt |
/../operations/src/test/kotlin/cards/arda/operations/reference/item/service/ |
MM-ISU-002 |
ItemSupplyInputSupplierEIdTest.kt |
/../operations/src/test/kotlin/cards/arda/operations/reference/item/service/ |
Task 3.1 |
ItemSupplyBackfillTest.kt |
/../operations/src/test/kotlin/cards/arda/operations/reference/item/service/ |
Task 3.2 |
Running Tests
To run all Item Supply related tests:
cd /../operations && ./gradlew test --tests "cards.arda.operations.reference.item.*"
To run tests for a specific file:
cd /../operations && ./gradlew test --tests "cards.arda.operations.reference.item.service.ItemServiceDeleteTest"
Copyright: © Arda Systems 2025-2026, All rights reserved