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

refactor: Decompose NativeDriver to opaque interop drivers #415

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

adamrodger
Copy link
Contributor

This change adds an abstraction layer over the interop details (such as marshalling strings and handling error response codes) using the typestate pattern to encapsulate the possible operations. This means that all the interaction builders don't need to keep track of interop concerns such as pact handles and interaction handles because those are all encapsulated in the abstraction layer.

Note that HTTP pacts and message pacts are different in that multiple HTTP interactions can be added to a pact before the mock server is started and the file is written, whereas only one message interaction can be configured/verified before the file is written. This creates a slight asymmetry in the API for where the file writing method is defined, but for good reason.

This should pave the way for adding specification v4 support.

@adamrodger
Copy link
Contributor Author

Note that the CI is failing on MacOS due to pact-foundation/pact-reference#210

This change adds an abstraction layer over the interop details (such as
marshalling strings and handling error response codes) using the
typestate pattern to encapsulate the possible operations. This means
that all the interaction builders don't need to keep track of interop
concerns such as pact handles and interaction handles because those are
all encapsulated in the abstraction layer.

Note that HTTP pacts and message pacts are different in that multiple
HTTP interactions can be added to a pact before the mock server is
started and the file is written, whereas only one message interaction
can be configured/verified before the file is written. This creates a
slight asymmetry in the API for where the file writing method is defined,
but for good reason.

This should pave the way for adding specification v4 support.
@adamrodger adamrodger merged commit 00a0437 into master Aug 2, 2022
@adamrodger adamrodger deleted the refactor/interop-drivers branch August 2, 2022 09:31
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.

None yet

1 participant