fix(go): distinguish endpoints with same path/method in wiremock tests #11716
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Link to Devin run: https://app.devin.ai/sessions/780cc9b46a10467e93de7d459bd7609f
Requested by: William McAdams (@musicpulpite)
Fixes an issue where Go wiremock test generation was not distinguishing between endpoints that share the same URL path and HTTP method but have different names. This caused collisions when APIs have both streaming and non-streaming variants of the same endpoint (e.g.,
chatandchat_streamboth at/v1/chat), or versioned endpoints like/v1/chatand/v2/chat.Changes Made
wiremockMappingKeyto include the endpoint name in the key format:${method} - ${urlPath} - ${endpointName}getWireMockConfigContentto extract the endpoint name from the mapping name when building the lookup keybuildBasePathto include the endpoint name when looking up wiremock mappingsTesting
Human Review Checklist
getWireMockConfigContentextracts endpoint name viamapping.name.split(" - ")[0], whilebuildBasePathusesendpoint.displayName ?? endpoint.name.originalName. These should match since mapping names are constructed as${displayName || originalName} - ${exampleName}.