We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I have a test with:
@Pact(provider = "UserService", consumer = "UserConsumer") V4Pact getAllUsers(PactBuilder builder) { return builder .given("Users exist") .usingLegacyDsl() .uponReceiving("A request to get all users") .path("/api/users") .method("GET") .willRespondWith() .status(200) .headers(Map.of("Content-Type", "application/json")) .body("{\"2fd273a1-58f2-4409-a578-2bcadd8ab613\":{\"id\":\"2fd273a1-58f2-4409-a578-2bcadd8ab613\",\"firstName\":\"John\",\"lastName\":\"Doe\",\"dateOfBirth\":\"01-01-1970\"}}") .toPact(V4Pact.class); }
Then:
Actual: The contract does not include a provider state for the interation
Expected: Interaction includes attribute providerstate with value "User exist"
The text was updated successfully, but these errors were encountered:
Specifying as follows does include provider state:
@Pact(provider = "UserService", consumer = "UserConsumer") V4Pact getAllUsers(PactBuilder builder) { return builder .given("Users exist") .expectsToReceiveHttpInteraction("A request to get all users", httpBuilder -> { return httpBuilder .withRequest(requestBuilder -> requestBuilder .path("/api/users") .method("GET")) .willRespondWith(responseBuilder -> responseBuilder .status(200) .body("{\"2fd273a1-58f2-4409-a578-2bcadd8ab613\":{\"id\":\"2fd273a1-58f2-4409-a578-2bcadd8ab613\",\"firstName\":\"John\",\"lastName\":\"Doe\",\"dateOfBirth\":\"01-01-1970\"}}") .header("Content-Type", "application/json") ) .comment("This is also a comment"); }) .comment("This is also a comment") .toPact(); }
Sorry, something went wrong.
No branches or pull requests
When I have a test with:
Then:
Actual:
The contract does not include a provider state for the interation
Expected:
Interaction includes attribute providerstate with value "User exist"
The text was updated successfully, but these errors were encountered: