Practice the vocabulary of consumer-driven contract testing with Pact: consumer tests, provider verification, and can-i-deploy.
0 / 26 completed
1 / 26
In Pact contract testing, who 'defines the expectations' in a consumer-driven contract?
In consumer-driven contracts, the consumer writes tests that capture its expectations of the provider's API. These expectations become the contract the provider must satisfy.
2 / 26
What happens during 'provider verification' in a Pact workflow?
Provider verification is when the provider side runs the published contract against its actual implementation. If all interactions pass, the provider is verified against that consumer version.
3 / 26
A team says 'we use can-i-deploy before every production release'. What does can-i-deploy check?
can-i-deploy is a Pact CLI command that queries the Pact Broker to confirm that the specific versions of consumer and provider about to be deployed are compatible (have a passing verification).
4 / 26
What is the 'Pact Broker' in a contract testing workflow?
The Pact Broker is a shared repository for contracts (pacts) and verification results. It enables consumers and providers to publish and retrieve contracts independently without sharing code.
5 / 26
A developer says 'the consumer test is green but provider verification failed'. What does this mean?
When provider verification fails, it means the provider's real implementation returns something that doesn't match what the consumer expected — a breaking change or divergence that must be resolved before deployment.
6 / 26
Sarah: "Hey team, I'm getting a 'Schema Drift' error when consuming the User Profile Service. The contract looks correct, but the provider is reporting that the field 'phone_number' has changed from string to integer in their latest version."
Sarah's message highlights a common scenario in consumer-driven contracts. While schema drift is problematic, simply reverting the contract isn't the solution—it masks the underlying issue and can lead to cascading problems. The correct approach involves the consumer and provider working together to update the contract to accommodate the change in the User Profile Service's data types, likely adding appropriate validation logic on the consumer side. This ensures ongoing compatibility while addressing the new requirement.
7 / 26
John: 'I've just submitted a PR to update the User Service contract. The consumer tests are passing, but I'm seeing a warning in the Pact Broker about potential schema drift. Should I immediately merge this PR, or do I need to investigate further before deploying?'
This scenario highlights the importance of actively monitoring the Pact Broker. While passing consumer tests are reassuring, warnings about schema drift indicate potential incompatibility between the contract and the provider's actual implementation. Ignoring these warnings could lead to runtime errors in production. The correct action is to investigate the broker's report – it signals a need for consumer adaptation rather than simply accepting the change without validation. Option A is incorrect because passing tests don't guarantee compatibility, and options B and D are premature steps before understanding the root cause.
8 / 26
David is discussing a recent change to the User Profile Service with his team. He's updated the contract to reflect a shift in the `phone_number` field type (string -> integer), but after provider verification, he's receiving a warning about potential schema drift within the Pact Broker. David asks: 'Given this warning, what is the *most* important next step for ensuring a smooth deployment?'
The correct answer is investigating the Pact Broker logs and provider verification. Ignoring the warning or immediately merging the PR are both risky – schema drift can have cascading effects that aren't immediately apparent from passing consumer tests. Provider verification reveals whether the service actually *meets* the contract expectations, including the expected data types; this investigation is crucial to understanding the true extent of the change and its potential impact on dependent systems. Rolling back would only delay the inevitable if the underlying problem isn't addressed.
9 / 26
John just submitted a PR to update the User Profile Service contract after changing the `phone_number` field from string to integer. The consumer tests are passing, but he's received a warning in the Pact Broker about potential schema drift. He's considering merging the PR immediately. Which of the following actions represents the *most* critical next step to mitigate the risk of deploying an incompatible service?
The key here is understanding that Pact's schema drift detection isn't a simple pass/fail. The warning in the Pact Broker signals a potential incompatibility between the consumer and provider versions. Running provider verification again, specifically looking for schema drift warnings, is crucial to confirm the provider has correctly updated their contract and allows the team to proactively implement error handling or adjustments within the consumer if necessary. Ignoring the warning would be risky; simply passing consumer tests doesn't guarantee compatibility with the *latest* provider version – it only confirms that the current version is compatible.
10 / 26
Sarah: "Hey team, I'm getting a 'Schema Drift' error when consuming the User Profile Service. The contract looks correct, but the provider is reporting that the field 'phone_number' has changed from string to integer in their latest version."
Sarah's message highlights a common scenario in consumer-driven contracts. While schema drift is problematic, simply reverting the contract isn't the solution—it masks the underlying issue and can lead to cascading problems. The correct approach involves the consumer and provider working together to update the contract to accommodate the change in the User Profile Service's data types, likely adding appropriate validation logic on the consumer side. This ensures ongoing compatibility while addressing the new requirement.
11 / 26
John: 'I've just submitted a PR to update the User Service contract. The consumer tests are passing, but I'm seeing a warning in the Pact Broker about potential schema drift. Should I immediately merge this PR, or do I need to investigate further before deploying?'
This scenario highlights the importance of actively monitoring the Pact Broker. While passing consumer tests are reassuring, warnings about schema drift indicate potential incompatibility between the contract and the provider's actual implementation. Ignoring these warnings could lead to runtime errors in production. The correct action is to investigate the broker's report – it signals a need for consumer adaptation rather than simply accepting the change without validation. Option A is incorrect because passing tests don't guarantee compatibility, and options B and D are premature steps before understanding the root cause.
12 / 26
David is discussing a recent change to the User Profile Service with his team. He's updated the contract to reflect a shift in the `phone_number` field type (string -> integer), but after provider verification, he's receiving a warning about potential schema drift within the Pact Broker. David asks: 'Given this warning, what is the *most* important next step for ensuring a smooth deployment?'
The correct answer is investigating the Pact Broker logs and provider verification. Ignoring the warning or immediately merging the PR are both risky – schema drift can have cascading effects that aren't immediately apparent from passing consumer tests. Provider verification reveals whether the service actually *meets* the contract expectations, including the expected data types; this investigation is crucial to understanding the true extent of the change and its potential impact on dependent systems. Rolling back would only delay the inevitable if the underlying problem isn't addressed.
13 / 26
John just submitted a PR to update the User Profile Service contract after changing the `phone_number` field from string to integer. The consumer tests are passing, but he's received a warning in the Pact Broker about potential schema drift. He's considering merging the PR immediately. Which of the following actions represents the *most* critical next step to mitigate the risk of deploying an incompatible service?
The key here is understanding that Pact's schema drift detection isn't a simple pass/fail. The warning in the Pact Broker signals a potential incompatibility between the consumer and provider versions. Running provider verification again, specifically looking for schema drift warnings, is crucial to confirm the provider has correctly updated their contract and allows the team to proactively implement error handling or adjustments within the consumer if necessary. Ignoring the warning would be risky; simply passing consumer tests doesn't guarantee compatibility with the *latest* provider version – it only confirms that the current version is compatible.
14 / 26
Sarah: "Hey team, I'm getting a 'Schema Drift' error when consuming the User Profile Service. The contract looks correct, but the provider is reporting that the field 'phone_number' has changed from string to integer in their latest version."
Sarah's message highlights a common scenario in consumer-driven contracts. While schema drift is problematic, simply reverting the contract isn't the solution—it masks the underlying issue and can lead to cascading problems. The correct approach involves the consumer and provider working together to update the contract to accommodate the change in the User Profile Service's data types, likely adding appropriate validation logic on the consumer side. This ensures ongoing compatibility while addressing the new requirement.
15 / 26
John: 'I've just submitted a PR to update the User Service contract. The consumer tests are passing, but I'm seeing a warning in the Pact Broker about potential schema drift. Should I immediately merge this PR, or do I need to investigate further before deploying?'
This scenario highlights the importance of actively monitoring the Pact Broker. While passing consumer tests are reassuring, warnings about schema drift indicate potential incompatibility between the contract and the provider's actual implementation. Ignoring these warnings could lead to runtime errors in production. The correct action is to investigate the broker's report – it signals a need for consumer adaptation rather than simply accepting the change without validation. Option A is incorrect because passing tests don't guarantee compatibility, and options B and D are premature steps before understanding the root cause.
16 / 26
David is discussing a recent change to the User Profile Service with his team. He's updated the contract to reflect a shift in the `phone_number` field type (string -> integer), but after provider verification, he's receiving a warning about potential schema drift within the Pact Broker. David asks: 'Given this warning, what is the *most* important next step for ensuring a smooth deployment?'
The correct answer is investigating the Pact Broker logs and provider verification. Ignoring the warning or immediately merging the PR are both risky – schema drift can have cascading effects that aren't immediately apparent from passing consumer tests. Provider verification reveals whether the service actually *meets* the contract expectations, including the expected data types; this investigation is crucial to understanding the true extent of the change and its potential impact on dependent systems. Rolling back would only delay the inevitable if the underlying problem isn't addressed.
17 / 26
John just submitted a PR to update the User Profile Service contract after changing the `phone_number` field from string to integer. The consumer tests are passing, but he's received a warning in the Pact Broker about potential schema drift. He's considering merging the PR immediately. Which of the following actions represents the *most* critical next step to mitigate the risk of deploying an incompatible service?
The key here is understanding that Pact's schema drift detection isn't a simple pass/fail. The warning in the Pact Broker signals a potential incompatibility between the consumer and provider versions. Running provider verification again, specifically looking for schema drift warnings, is crucial to confirm the provider has correctly updated their contract and allows the team to proactively implement error handling or adjustments within the consumer if necessary. Ignoring the warning would be risky; simply passing consumer tests doesn't guarantee compatibility with the *latest* provider version – it only confirms that the current version is compatible.
18 / 26
Sarah: "Hey team, I'm getting a 'Schema Drift' error when consuming the User Profile Service. The contract looks correct, but the provider is reporting that the field 'phone_number' has changed from string to integer in their latest version."
Sarah's message highlights a common scenario in consumer-driven contracts. While schema drift is problematic, simply reverting the contract isn't the solution—it masks the underlying issue and can lead to cascading problems. The correct approach involves the consumer and provider working together to update the contract to accommodate the change in the User Profile Service's data types, likely adding appropriate validation logic on the consumer side. This ensures ongoing compatibility while addressing the new requirement.
19 / 26
John: 'I've just submitted a PR to update the User Service contract. The consumer tests are passing, but I'm seeing a warning in the Pact Broker about potential schema drift. Should I immediately merge this PR, or do I need to investigate further before deploying?'
This scenario highlights the importance of actively monitoring the Pact Broker. While passing consumer tests are reassuring, warnings about schema drift indicate potential incompatibility between the contract and the provider's actual implementation. Ignoring these warnings could lead to runtime errors in production. The correct action is to investigate the broker's report – it signals a need for consumer adaptation rather than simply accepting the change without validation. Option A is incorrect because passing tests don't guarantee compatibility, and options B and D are premature steps before understanding the root cause.
20 / 26
David is discussing a recent change to the User Profile Service with his team. He's updated the contract to reflect a shift in the `phone_number` field type (string -> integer), but after provider verification, he's receiving a warning about potential schema drift within the Pact Broker. David asks: 'Given this warning, what is the *most* important next step for ensuring a smooth deployment?'
The correct answer is investigating the Pact Broker logs and provider verification. Ignoring the warning or immediately merging the PR are both risky – schema drift can have cascading effects that aren't immediately apparent from passing consumer tests. Provider verification reveals whether the service actually *meets* the contract expectations, including the expected data types; this investigation is crucial to understanding the true extent of the change and its potential impact on dependent systems. Rolling back would only delay the inevitable if the underlying problem isn't addressed.
21 / 26
John just submitted a PR to update the User Profile Service contract after changing the `phone_number` field from string to integer. The consumer tests are passing, but he's received a warning in the Pact Broker about potential schema drift. He's considering merging the PR immediately. Which of the following actions represents the *most* critical next step to mitigate the risk of deploying an incompatible service?
The key here is understanding that Pact's schema drift detection isn't a simple pass/fail. The warning in the Pact Broker signals a potential incompatibility between the consumer and provider versions. Running provider verification again, specifically looking for schema drift warnings, is crucial to confirm the provider has correctly updated their contract and allows the team to proactively implement error handling or adjustments within the consumer if necessary. Ignoring the warning would be risky; simply passing consumer tests doesn't guarantee compatibility with the *latest* provider version – it only confirms that the current version is compatible.
22 / 26
John comments on a code review of a PR updating the `OrderService` contract: 'I'm seeing a Pact Broker warning about schema drift. The consumer tests pass locally, but I'm concerned about potential inconsistencies when the provider updates its data format. Should I investigate the consumer tests further to ensure they accurately reflect the new provider schema, or focus on immediately addressing the Pact Broker warning?'
This scenario focuses on proactive risk management. Schema drift warnings in Pact Broker highlight discrepancies between the consumer and provider expectations. The correct approach involves validating the consumer tests to confirm they handle the new schema correctly; ignoring the warning could lead to runtime errors. Option A is a common misunderstanding – consumer tests aren't *always* sufficient.
23 / 26
Maria sends a Slack message to the team: 'I'm getting a 'Schema Drift' error when consuming the `ProductService` contract. The contract specifies a `price` field as a decimal (decimal(10,2)), but the provider is now returning it as a string. My consumer code is throwing a parsing exception. What should I do first?'
Maria's message presents a common scenario: a mismatch in data types. The immediate response should be to troubleshoot the consumer code and understand *why* it's failing to parse the string representation of the `price`. Changing the contract prematurely could mask the underlying issue. Option A is incorrect because changing the contract without understanding the problem isn't best practice; ignoring the error would lead to continued issues.
24 / 26
The Provider Service returns the following API response when queried for a user's profile:
{
"user_id": "12345",
"email": "john.doe@example.com",
"phone_number": "+1-555-123-4567"
}
The consumer service, using a Pact Broker contract, expects the `phone_number` field to be an integer (int). Which action should the developer take?
This scenario highlights the importance of contract fidelity. The consumer service's expectation (integer) doesn't align with the provider's actual response (string). The correct approach is to update the Pact Broker contract to match the provider's data type—this ensures that the consumer receives the expected data, even if it needs conversion. Notifying the provider is a good follow-up step.
25 / 26
David writes the following description for a PR updating the `CustomerService` contract: 'This change introduces support for new international phone number formats. The consumer service now handles phone numbers in E.164 format (+country_code-area_code-number). The Pact Broker contract has been updated to reflect this change, and consumer tests pass.' What is the *most* important follow-up step after merging this PR?
While all options have some relevance, the *most* crucial step is to confirm that the provider's data pipeline is correctly transforming phone numbers into E.164 format. If the provider isn't generating the correct format, the consumer service will still experience issues—this is the root cause of schema drift. Monitoring logs and updating documentation are important but secondary.
26 / 26
Sarah reports in a daily stand-up: 'I'm seeing a 'Schema Drift' warning in the Pact Broker when consuming the `InventoryService` contract. The contract defines the `quantity` field as an integer, but the provider is sending it as a string. I've updated the contract to match, and the consumer tests are passing now.' How should she best communicate this resolution to her team?
Sarah's report should concisely summarize the problem and the solution. The key is to clearly state that a schema drift warning was resolved by updating the contract—this provides context for other team members. Option A is overly enthusiastic; options B is the most informative and professional, while the others are incomplete or misleading.
What will I practice in "Consumer-Driven Contracts Language Quiz"?
This is an API Contract Testing exercise set. It walks through 26 scenario-based multiple-choice questions built around real usage of API Contract Testing terminology that IT professionals encounter on the job.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to complete with no account, sign-up, or paywall.
How many questions are in this exercise?
This set contains 26 questions. Each one shows immediate feedback and a detailed explanation after you answer, so you learn the correct usage right away rather than waiting for a final score.
Do I need prior experience to complete this exercise?
No prior experience is required. Each question includes a full explanation covering the reasoning behind the correct answer, so the exercise itself teaches the API Contract Testing vocabulary as you go.
Can I retry the exercise if I get questions wrong?
Yes — use the "Try again" button on the results screen to reset your answers and go through all the questions again. There is no limit on attempts.
Is my progress saved?
Your answers and score for the current session are tracked in the browser as you go. No account or login is needed, and there is nothing to install.
What if I don't understand a term used in a question?
Read the explanation shown after you answer each question — it breaks down the correct term in plain English with a real-world example. You can also check the site Glossary for quick definitions.
How is this different from reading a blog article on the topic?
Exercises like this one are interactive drills that test and reinforce specific vocabulary through multiple-choice questions, while blog articles explain concepts in prose. Practising here after reading builds active recall, not just passive recognition.
Where can I find more API Contract Testing exercises?
See the API Contract Testing exercises hub for the full set of related pages, or browse all exercise categories from the main Exercises index.
Can I use this exercise to prepare for a technical interview?
Yes — API Contract Testing vocabulary comes up often in technical discussions and interviews. Pair this exercise with our dedicated Interview Preparation section for role-specific practice.