-
Notifications
You must be signed in to change notification settings - Fork 0
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
Change the PactMock DSL #241
Comments
ludorival
added a commit
that referenced
this issue
Jan 4, 2025
- Fixes #241 - Added `clearPact` and `getCurrentPact` methods to `PactMock` for better pact management. - Introduced `state` and `anError` utility functions for improved interaction handling. - Refactored interaction definitions in test contracts to use `uponReceiving` and `withDescription` for clarity and consistency. - Updated `willRespondWith` and related methods to streamline response handling in mock setups. - Improved README documentation to reflect changes in usage patterns with Mockk and Mockito. These enhancements aim to simplify the mocking process and improve the overall usability of the pact-jvm-mock library.
Merged
ludorival
added a commit
that referenced
this issue
Jan 4, 2025
* Change the PactMock DSL - Fixes #241 - Added `clearPact` and `getCurrentPact` methods to `PactMock` for better pact management. - Introduced `state` and `anError` utility functions for improved interaction handling. - Refactored interaction definitions in test contracts to use `uponReceiving` and `withDescription` for clarity and consistency. - Updated `willRespondWith` and related methods to streamline response handling in mock setups. - Improved README documentation to reflect changes in usage patterns with Mockk and Mockito. These enhancements aim to simplify the mocking process and improve the overall usability of the pact-jvm-mock library. * Refactor pact-jvm-mock to use PactConfiguration instead of PactOptions - Replaced `PactOptions` with `PactConfiguration` throughout the codebase for improved clarity and consistency in configuration management. - Updated README documentation to reflect the new configuration approach and provide clearer examples. - Modified the `PactConsumer` annotation to accept `PactConfiguration` types. - Removed the obsolete `PactOptions` class and related methods, streamlining the pact management process. - Enhanced test classes to utilize the new configuration structure, ensuring compatibility with existing tests. These changes aim to simplify the configuration process and improve the overall usability of the pact-jvm-mock library.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Enhancement: Introduce More Fluent DSL for PactMock Contract Generation
Currently, developers need to use a combination of
every
andwillRespond
/willRespondWith
to generate Pact contracts from Mockk mocks. While functional, we can make this more intuitive and fluent by introducing a new DSL.Current Syntax
Proposed Syntax
Benefits
Implementation Notes
uponReceiving
The text was updated successfully, but these errors were encountered: