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

plain text request body not matching? #443

Closed
yekster opened this issue May 24, 2017 · 1 comment
Closed

plain text request body not matching? #443

yekster opened this issue May 24, 2017 · 1 comment
Labels
enhancement Indicates new feature requests

Comments

@yekster
Copy link

yekster commented May 24, 2017

Sorry for the noob question, but I can't seem to get plain text request body to match the result. Changing to json works fine, so I'm not sure what I'm doing wrong. :(

service {
            given('scenario for adding random plain text')
            uponReceiving('random text')
            withAttributes(
                    method: 'post',
                    path: '/random',
                    headers: headers,
                    body: regexp(~/\w+/,"randomText"))
            willRespondWith(status: 200)
        }

        PactVerificationResult result = service.runTest { mockServer ->
            def client = new RESTClient(mockServer.url)

            def auth_response = client.post(
                    path: '/random',
                    headers : headers,
                    body: "randomText")

            assert auth_response.status == 200
        }
        assert result == PactVerificationResult.Ok.INSTANCE
@uglyog
Copy link
Member

uglyog commented May 24, 2017

Matching has not been implemented for plain text yet. It should be a simple thing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Indicates new feature requests
Projects
None yet
Development

No branches or pull requests

4 participants