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

Consider: Support nested block and flat call structure #7

Closed
usr42 opened this issue Aug 25, 2018 · 1 comment
Closed

Consider: Support nested block and flat call structure #7

usr42 opened this issue Aug 25, 2018 · 1 comment

Comments

@usr42
Copy link
Owner

usr42 commented Aug 25, 2018

Support nested block and flat call structure with invoke method (see Kotlin in Action 11.3.3).

            KPact.consumer("Some Consumer").hasPactWith("Some Provider") {
                given("a certain state on the provider") {
                    whenever("a request for something").withPath("/hello") {
                        method("POST")
                        body("{\"name\": \"harry\"}")
                    } thenRespondWith {
                        status(200)
                        body("{\"hello\": \"harry\"}")
                    }
            }

vs

            KPact.consumer("Some Consumer").hasPactWith("Some Provider")
                    .given("a certain state on the provider").whenever("a request for something")
                    .withPath("/hello") {
                        method("POST")
                        body("{\"name\": \"harry\"}")
                    } thenRespondWith {
                        status(200)
                        body("{\"hello\": \"harry\"}")
                    }
            }
@usr42
Copy link
Owner Author

usr42 commented Aug 25, 2018

Now that I see the example, I don't like it.

@usr42 usr42 closed this as completed Aug 25, 2018
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

No branches or pull requests

1 participant