8000 Add SOAPAction header support to Scenario apiDescription property by Copilot · Pull Request #1877 · specmatic/specmatic · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add SOAPAction header support to Scenario apiDescription property #1877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 31, 2025

Conversation

Copilot
Copy link
Contributor
@Copilot Copilot AI commented May 31, 2025

Problem

The apiDescription property in Scenario.kt did not include SOAPAction header information in test descriptions, making it difficult to distinguish between different SOAP operations that use the same endpoint but different SOAPAction values.

Solution

Modified the apiDescription property to include SOAPAction header values when present:

  • With SOAPAction: "POST /soap/service SOAP Action http://example.com/action -> 200"
  • Without SOAPAction: "POST /soap/service -> 200" (unchanged from original)

Implementation Details

  1. Converted apiDescription from a simple property to a computed property that dynamically checks for SOAPAction headers
  2. Added case-insensitive matching for "SOAPAction" header names to handle variations like "soapaction", "SoapAction", etc.
  3. Only extracts values from ExactValuePattern instances to ensure we have concrete SOAPAction values (ignores generic string patterns)
  4. Maintains full backward compatibility - all non-SOAP scenarios continue to work exactly as before
  5. Minimal implementation - only 19 lines of code added

Example Usage

Before:

Scenario: POST /CalculatorService.asmx -> 200

After (with SOAPAction):

Scenario: POST /CalculatorService.asmx SOAP Action http://tempuri.org/Add -> 200

Testing

Added comprehensive test suite covering:

  • ✅ SOAPAction header present with exact value
  • ✅ SOAPAction header absent (backward compatibility)
  • ✅ Case-insensitive header matching
  • ✅ Non-exact pattern handling (ignored correctly)
  • ✅ Integration with testDescription() method

All existing tests continue to pass, ensuring no regressions.

Files Changed

  • core/src/main/kotlin/io/specmatic/core/Scenario.kt - Modified apiDescription property
  • core/src/test/kotlin/io/specmatic/core/ScenarioSOAPActionTest.kt - New comprehensive test suite

Fixes the issue where SOAP test descriptions lacked operation-specific information, making test results more informative and easier to debug.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.github.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx768m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.14.1-all/ai1r9v1zgfsr225kjzlvo0rag/gradle-8.14.1/lib/gradle-daemon-main-8.14.1.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.14.1-all/ai1r9v1zgfsr225kjzlvo0rag/gradle-8.14.1/lib/agents/gradl 8000 e-instrumentation-agent-8.14.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.14.1 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: joelrosario <63343+joelrosario@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Include SOAPAction header in apiDescription if present for Scenario.kt Add SOAPAction header support to Scenario apiDescription property May 31, 2025
@Copilot Copilot AI requested a review from joelrosario May 31, 2025 07:57
Copilot finished work on behalf of joelrosario May 31, 2025 07:57
…ests

Co-authored-by: joelrosario <63343+joelrosario@users.noreply.github.com>
Copilot finished work on behalf of joelrosario May 31, 2025 08:26
@joelrosario joelrosario marked this pull request as ready for review May 31, 2025 08:58
@joelrosario joelrosario merged commit 294b7db into main May 31, 2025
2 of 3 checks passed
@joelrosario joelrosario deleted the copilot/fix-e94aac52-c5ee-4ce2-8edc-bd982338a281 branch May 31, 2025 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0