Skip to content

Conversation

@tobyweston
Copy link
Member

I see the test as having two elements 1) the stubbed behaviour that mimics the server (the "contract") and 2) assertions against that.

Experiment to try and formalise that by splitting the former into a Contract type. This is really a place to collect factory style methods to setup the stubs. So you might have different methods there to document what you'd expect from different endpoints in different scenarios.

In most of my apps when local / unit testings, we tent to have a bunch a stub creation methods, some parameterised to be configurable.

Something to reflect on (not expecting anyone to merge the PR) and discuss.

.body(expectedAccountsBody())
.toPact();
}
@Pact(provider = "account_provider", consumer = "mobile_consumer")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Pact annotations are BS. Is there a way to do this programmatically within the test.

Annotations = bad news (generally) 🔥

@tobyweston tobyweston closed this Jun 8, 2021
@tobyweston tobyweston reopened this Jun 8, 2021
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.

3 participants