Skip to content

Commit bf2cc73

Browse files
committed
chore(tests): correct stale PublicationApprovalRequested/Completed fixtures
Fixture-only change (no production code affected) as part of a cross-runtime audit of PublicationApprovalRequested and PublicationEvaluationCompleted (openspec change publication-event-parity). Java's producer/schema for PublicationApprovalRequested were already fixed earlier this session (commit ebd8086); this re-audit confirmed that fix is still correct and clean. PublicationEvaluationCompleted's producer/schema/consumer were already correct. Only the test fixtures had drifted. Updated all 6 publication_approval_requested_event*.json fixtures under unicorn_approvals/ApprovalsService/src/test/events/eventbridge/, plus the older-vintage put_event_publication_approval_requested.json: removed contract/listprice/currency and added the missing status: "PENDING" field (all 7 fixtures were missing it even though the producer sets it). put_event_publication_approval_requested.json additionally had a fully flat, non-nested address shape predating the nested-address fix - restructured to nested address to match the current schema. Confirmed via repo-wide search that none of these 7 files are loaded by any .java test before editing. Removed the stray, undocumented result_reason field from publication_evaluation_completed_event.json (present in no schema, producer, or consumer in any of the four runtimes; identical unused fixture found in all four repos as part of this same change). Verified: mvn test on ApprovalsService passes 10/10 (Contract Status 3, PropertiesApprovalSync 4, WaitForContractApproval 3 - unaffected, as expected for dead fixtures). sam validate --lint clean on the Approvals service template.
1 parent 7ef436b commit bf2cc73

8 files changed

Lines changed: 14 additions & 17 deletions

unicorn_approvals/ApprovalsService/src/test/events/eventbridge/publication_approval_requested_event.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@
99
"resources": [],
1010
"detail": {
1111
"property_id": "usa/anytown/main-street/111",
12+
"status": "PENDING",
1213
"address": {
1314
"country": "USA",
1415
"city": "Anytown",
1516
"street": "Main Street",
1617
"number": 111
1718
},
1819
"description": "This classic Anytown estate comes with a covetable lake view. The romantic and comfortable backyard is the perfect setting for unicorn get-togethers. The open concept Main Stable is fully equipped with all the desired amenities. Second floor features 6 straw bales including large Rainbow Suite with private training pool terrace and Jr Sparkles Suite.",
19-
"contract": "sale",
20-
"listprice": 200,
21-
"currency": "SPL",
2220
"images": [
2321
"property_images/prop1_exterior1.jpg",
2422
"property_images/prop1_interior1.jpg",

unicorn_approvals/ApprovalsService/src/test/events/eventbridge/publication_approval_requested_event_all_good.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"DetailType": "PublicationApprovalRequested",
44
"Source": "unicorn-web",
55
"EventBusName": "unicorn-approvals-eventbus-local",
6-
"Detail": "{\"property_id\":\"usa/anytown/main-street/222\",\"address\":{\"country\":\"USA\",\"city\":\"Anytown\",\"street\":\"Main Street\",\"number\":222},\"description\":\"This classic Anytown estate comes with a covetable lake view. The romantic and comfortable backyard is the perfect setting for unicorn get-togethers. The open concept Main Stable is fully equipped with all the desired amenities. Second floor features 6 straw bales including large Rainbow Suite with private training pool terrace and Jr Sparkles Suite.\",\"contract\":\"sale\",\"listprice\":200,\"currency\":\"SPL\",\"images\":[\"property_images/prop1_exterior1.jpg\",\"property_images/prop1_interior1.jpg\",\"property_images/prop1_interior2.jpg\",\"property_images/prop1_interior3.jpg\"]}"
6+
"Detail": "{\"property_id\":\"usa/anytown/main-street/222\",\"status\":\"PENDING\",\"address\":{\"country\":\"USA\",\"city\":\"Anytown\",\"street\":\"Main Street\",\"number\":222},\"description\":\"This classic Anytown estate comes with a covetable lake view. The romantic and comfortable backyard is the perfect setting for unicorn get-togethers. The open concept Main Stable is fully equipped with all the desired amenities. Second floor features 6 straw bales including large Rainbow Suite with private training pool terrace and Jr Sparkles Suite.\",\"images\":[\"property_images/prop1_exterior1.jpg\",\"property_images/prop1_interior1.jpg\",\"property_images/prop1_interior2.jpg\",\"property_images/prop1_interior3.jpg\"]}"
77
}
8-
]
8+
]

unicorn_approvals/ApprovalsService/src/test/events/eventbridge/publication_approval_requested_event_inappropriate_description.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"DetailType": "PublicationApprovalRequested",
44
"Source": "unicorn-web",
55
"EventBusName": "unicorn-approvals-eventbus-local",
6-
"Detail": "{\"property_id\":\"usa/anytown/main-street/111\",\"address\":{\"country\":\"USA\",\"city\":\"Anytown\",\"street\":\"Main Street\",\"number\":111},\"description\":\"This is a property for goblins. The property has the worst quality and is atrocious when it comes to design. The property is not clean whatsoever, and will make any property owner have buyers' remorse as soon the property is bought. Keep away from this property as much as possible!\",\"contract\":\"sale\",\"listprice\":200,\"currency\":\"SPL\",\"images\":[\"property_images/prop1_exterior1.jpg\",\"property_images/prop1_interior1.jpg\",\"property_images/prop1_interior2.jpg\",\"property_images/prop1_interior3.jpg\"]}"
6+
"Detail": "{\"property_id\":\"usa/anytown/main-street/111\",\"status\":\"PENDING\",\"address\":{\"country\":\"USA\",\"city\":\"Anytown\",\"street\":\"Main Street\",\"number\":111},\"description\":\"This is a property for goblins. The property has the worst quality and is atrocious when it comes to design. The property is not clean whatsoever, and will make any property owner have buyers' remorse as soon the property is bought. Keep away from this property as much as possible!\",\"images\":[\"property_images/prop1_exterior1.jpg\",\"property_images/prop1_interior1.jpg\",\"property_images/prop1_interior2.jpg\",\"property_images/prop1_interior3.jpg\"]}"
77
}
8-
]
8+
]

unicorn_approvals/ApprovalsService/src/test/events/eventbridge/publication_approval_requested_event_inappropriate_images.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"DetailType": "PublicationApprovalRequested",
44
"Source": "unicorn-web",
55
"EventBusName": "unicorn-approvals-eventbus-local",
6-
"Detail": "{\"property_id\":\"usa/anytown/main-street/111\",\"address\":{\"country\":\"USA\",\"city\":\"Anytown\",\"street\":\"Main Street\",\"number\":111},\"description\":\"This classic Anytown estate comes with a covetable lake view. The romantic and comfortable backyard is the perfect setting for unicorn get-togethers. The open concept Main Stable is fully equipped with all the desired amenities. Second floor features 6 straw bales including large Rainbow Suite with private training pool terrace and Jr Sparkles Suite.\",\"contract\":\"sale\",\"listprice\":200,\"currency\":\"SPL\",\"images\":[\"property_images/prop1_exterior1.jpg\",\"property_images/prop1_interior1.jpg\",\"property_images/prop1_interior2.jpg\",\"property_images/prop1_interior3.jpg\",\"property_images/prop1_interior4-bad.jpg\"]}"
6+
"Detail": "{\"property_id\":\"usa/anytown/main-street/111\",\"status\":\"PENDING\",\"address\":{\"country\":\"USA\",\"city\":\"Anytown\",\"street\":\"Main Street\",\"number\":111},\"description\":\"This classic Anytown estate comes with a covetable lake view. The romantic and comfortable backyard is the perfect setting for unicorn get-togethers. The open concept Main Stable is fully equipped with all the desired amenities. Second floor features 6 straw bales including large Rainbow Suite with private training pool terrace and Jr Sparkles Suite.\",\"images\":[\"property_images/prop1_exterior1.jpg\",\"property_images/prop1_interior1.jpg\",\"property_images/prop1_interior2.jpg\",\"property_images/prop1_interior3.jpg\",\"property_images/prop1_interior4-bad.jpg\"]}"
77
}
8-
]
8+
]

unicorn_approvals/ApprovalsService/src/test/events/eventbridge/publication_approval_requested_event_non_existing_contract.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"DetailType": "PublicationApprovalRequested",
44
"Source": "unicorn-web",
55
"EventBusName": "unicorn-approvals-eventbus-local",
6-
"Detail": "{\"property_id\":\"usa/anytown/main-street/333\",\"address\":{\"country\":\"USA\",\"city\":\"Anytown\",\"street\":\"Main Street\",\"number\":333},\"description\":\"This classic Anytown estate comes with a covetable lake view. The romantic and comfortable backyard is the perfect setting for unicorn get-togethers. The open concept Main Stable is fully equipped with all the desired amenities. Second floor features 6 straw bales including large Rainbow Suite with private training pool terrace and Jr Sparkles Suite.\",\"contract\":\"sale\",\"listprice\":200,\"currency\":\"SPL\",\"images\":[\"property_images/prop1_exterior1.jpg\",\"property_images/prop1_interior1.jpg\",\"property_images/prop1_interior2.jpg\",\"property_images/prop1_interior3.jpg\"]}"
6+
"Detail": "{\"property_id\":\"usa/anytown/main-street/333\",\"status\":\"PENDING\",\"address\":{\"country\":\"USA\",\"city\":\"Anytown\",\"street\":\"Main Street\",\"number\":333},\"description\":\"This classic Anytown estate comes with a covetable lake view. The romantic and comfortable backyard is the perfect setting for unicorn get-togethers. The open concept Main Stable is fully equipped with all the desired amenities. Second floor features 6 straw bales including large Rainbow Suite with private training pool terrace and Jr Sparkles Suite.\",\"images\":[\"property_images/prop1_exterior1.jpg\",\"property_images/prop1_interior1.jpg\",\"property_images/prop1_interior2.jpg\",\"property_images/prop1_interior3.jpg\"]}"
77
}
8-
]
8+
]

unicorn_approvals/ApprovalsService/src/test/events/eventbridge/publication_approval_requested_event_pause_workflow.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"DetailType": "PublicationApprovalRequested",
44
"Source": "unicorn-web",
55
"EventBusName": "unicorn-approvals-eventbus-local",
6-
"Detail": "{\"property_id\":\"usa/anytown/main-street/111\",\"address\":{\"country\":\"USA\",\"city\":\"Anytown\",\"street\":\"Main Street\",\"number\":111},\"description\":\"This classic Anytown estate comes with a covetable lake view. The romantic and comfortable backyard is the perfect setting for unicorn get-togethers. The open concept Main Stable is fully equipped with all the desired amenities. Second floor features 6 straw bales including large Rainbow Suite with private training pool terrace and Jr Sparkles Suite.\",\"contract\":\"sale\",\"listprice\":200,\"currency\":\"SPL\",\"images\":[\"property_images/prop1_exterior1.jpg\",\"property_images/prop1_interior1.jpg\",\"property_images/prop1_interior2.jpg\",\"property_images/prop1_interior3.jpg\"]}"
6+
"Detail": "{\"property_id\":\"usa/anytown/main-street/111\",\"status\":\"PENDING\",\"address\":{\"country\":\"USA\",\"city\":\"Anytown\",\"street\":\"Main Street\",\"number\":111},\"description\":\"This classic Anytown estate comes with a covetable lake view. The romantic and comfortable backyard is the perfect setting for unicorn get-togethers. The open concept Main Stable is fully equipped with all the desired amenities. Second floor features 6 straw bales including large Rainbow Suite with private training pool terrace and Jr Sparkles Suite.\",\"images\":[\"property_images/prop1_exterior1.jpg\",\"property_images/prop1_interior1.jpg\",\"property_images/prop1_interior2.jpg\",\"property_images/prop1_interior3.jpg\"]}"
77
}
8-
]
8+
]

unicorn_approvals/ApprovalsService/src/test/events/eventbridge/publication_evaluation_completed_event.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
"resources": [],
1010
"detail": {
1111
"property_id": "usa/anytown/main-street/111",
12-
"evaluation_result": "APPROVED|DECLINED",
13-
"result_reason": "UNSAFE_IMAGE_DETECTED|BAD_SENTIMENT_DETECTED|..."
12+
"evaluation_result": "APPROVED|DECLINED"
1413
}
1514
}
1615

unicorn_approvals/ApprovalsService/src/test/events/put_event_publication_approval_requested.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"EventBusName": "Dev-UnicornApprovalsEventBus",
44
"Source": "unicorn-web",
55
"DetailType": "PublicationApprovalRequested",
6-
"Detail": "{\"property_id\": \"usa/anytown/main-street/123\",\"country\": \"USA\",\"city\": \"Anytown\",\"street\": \"Main Street\",\"number\": 123,\"description\": \"This classic Anytown estate comes with a covetable lake view. The romantic and comfortable backyard is the perfect setting for unicorn get-togethers. The open concept Main Stable is fully equipped with all the desired amenities. Second floor features 6 straw bales including large Rainbow Suite with private training pool terrace and Jr Sparkles Suite.\",\"contract\": \"sale\",\"listprice\": 200,\"currency\": \"SPL\",\"images\": [ \"usa/anytown/main-street-123-0d61b4e3\"]}"
6+
"Detail": "{\"property_id\": \"usa/anytown/main-street/123\",\"status\": \"PENDING\",\"address\": {\"country\": \"USA\",\"city\": \"Anytown\",\"street\": \"Main Street\",\"number\": 123},\"description\": \"This classic Anytown estate comes with a covetable lake view. The romantic and comfortable backyard is the perfect setting for unicorn get-togethers. The open concept Main Stable is fully equipped with all the desired amenities. Second floor features 6 straw bales including large Rainbow Suite with private training pool terrace and Jr Sparkles Suite.\",\"images\": [ \"usa/anytown/main-street-123-0d61b4e3\"]}"
77
}
8-
]
8+
]

0 commit comments

Comments
 (0)