Skip to content
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

Add support for mocking put endpoints #3763

Open
heshanpadmasiri opened this issue Nov 7, 2024 · 1 comment
Open

Add support for mocking put endpoints #3763

heshanpadmasiri opened this issue Nov 7, 2024 · 1 comment

Comments

@heshanpadmasiri
Copy link

Problem

Currently we can mock GET endpoints but not PUT endpoints (not sure about other kinds like POST). We need to be able to mock PUT endpoints (and others if they are not supported).

Proposed Solution

We need to be able to do

<mock-service>
    <service-name>CreateRecordEndPoint</service-name>
    <port>9090</port>
    <context>/mock</context>
    <resources>
        <resource>
            <sub-context>/create/?updateMode=M&amp;entPriority=P</sub-context>
            <method>PUT</method>
            <response>
                <status-code>200</status-code>
                <headers>
                    <header name="Content-Type" value="application/json" />
                </headers>
                <payload>
                    <![CDATA[{"working": true}]]>
                </payload>
            </response>
        </resource>
    </resources>
</mock-service>

Alternatives

No response

Version

No response

@SanojPunchihewa
Copy link
Contributor

As per the mock service creator[1] we haven't considered the PUT method. We may need to check the feasibility and add support for PUT method.

[1] - https://github.com/wso2/wso2-synapse/blob/master/modules/core/src/main/java/org/apache/synapse/unittest/MockServiceCreator.java#L129

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants