[Shopify] Migrate test mocking from IsTestInProgress to HttpClientHandler#7204
Conversation
…ientHandler Remove the legacy IsTestInProgress event-based mocking infrastructure from the Shopify Connector and migrate all tests to use the framework-level HttpClientHandler pattern. Production code changes: - Remove IsTestInProgress/SetTestInProgress/GetTestInProgress from ShpfyCommunicationMgt and all if-branches that routed HTTP to events - Delete ShpfyCommunicationEvents codeunit (5 legacy test events) - Remove GetTestInProgress early-exit guards from 5 order/fulfillment codeunits - Remove IsTestInProgress parameter from OnBeforeUploadImage event - Add InputSize > 0 guard in InventoryAPI.ExportStock Test code changes: - Migrate ~40 test codeunits to TestHttpRequestPolicy = BlockOutboundRequests with [HttpClientHandler] procedures and [HandlerFunctions] annotations - Delete 15 legacy subscriber codeunits; strip 2 others to non-HTTP events only - Use Library - Variable Storage for response queue routing in handlers - Standardize initialization: CreateShop + RegisterAccessTokenForShop Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove 35 local Shop variable declarations that shadow codeunit-level Shop - Rename Shop parameters to ShopParam to avoid AA0244 - Convert bare StrSubstNo format strings to Label constants (AA0217) - Fix unassigned DefaultVariantId variable (AA0205) - Remove unused ProductId variables (AA0206) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
a0927ba to
6ca6dcb
Compare
…te/onbuyuka/shpfytestmock
…event - Remove OnBeforeUploadImage event from ShpfyProductAPI (no longer needed with HttpClientHandler intercepting the PUT call directly) - Add PUT upload call to image sync handler response queues - Fix CreateUploadUrl fixture with valid https:// URIs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use data.node instead of data.currentBulkOperation to match what GetBulkRequest reads in production code. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All order-importing tests trigger RegisterFulfillmentService which
makes a GraphQL call. Added [HandlerFunctions('OrdersAPIHttpHandler')]
to 27 tests and a fallback else clause returning {"data":{}} for
unrecognized API calls.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Return {"data":{}} for unrecognized API calls when queue is empty.
Use CompanyLocationId as signal for company location response instead
of queue-based routing. Remove unused OutboundHttpRequests variable.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
…ytestmock # Conflicts: # src/Apps/W1/Shopify/Test/Inventory/ShpfyInventoryExportTest.Codeunit.al # src/Apps/W1/Shopify/Test/Inventory/ShpfyInventorySubscriber.Codeunit.al
…te/onbuyuka/shpfytestmock
Bootstrap CLAUDE.md, business-logic.md, and patterns.md at the app level, plus subfolder docs for Products, Companies, Inventory, and Bulk Operations. Covers test infrastructure patterns (HttpClientHandler mocking, lazy init, resource-based mock responses, retry state machines, Variable Storage queue). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
AL Documentation Audit
Documentation gaps were detected in the following apps:
- Shopify-Connector-Test: 62% documentation coverage
- Shopify-Connector: 79% documentation coverage
To generate documentation, run /al-docs init or /al-docs update using GitHub Copilot CLI or Claude Code.
This review is for awareness to help keep documentation in sync with code changes. It is okay to dismiss this request.
Resolve modify/delete conflicts on ShpfyProductCollectionSubs and ShpfySalesChannelSubs by keeping deletions -- these subscriber codeunits were replaced by HttpClientHandler mocking on this branch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Summary
IsTestInProgressevent-based mocking infrastructure from the Shopify Connector[HttpClientHandler]pattern withTestHttpRequestPolicy = BlockOutboundRequestsShpfyCommunicationEventscodeunit and 15 legacy subscriber codeunitsProduction code changes
IsTestInProgress/SetTestInProgress/GetTestInProgressfromShpfyCommunicationMgtand allif IsTestInProgressbranchesShpfyCommunicationEvents.Codeunit.al(5 legacy test-only events)GetTestInProgress()early-exit guards from 5 order/fulfillment codeunitsIsTestInProgressparameter fromOnBeforeUploadImageeventInputSize > 0guard inInventoryAPI.ExportStockto skip empty mutationsTest code changes
[HttpClientHandler]withLibrary - Variable Storagefor response queue routingCreateShop()+RegisterAccessTokenForShop()Test plan
Fixes AB#625871
🤖 Generated with Claude Code