Bird
0
0

You wrote a contract test that expects a JSON response with a field email. The test fails because the provider returns emailAddress instead. What is the best way to fix this?

medium📝 Debug Q14 of 15
Rest API - API Testing and Monitoring
You wrote a contract test that expects a JSON response with a field email. The test fails because the provider returns emailAddress instead. What is the best way to fix this?
AChange the provider to return <code>email</code> as expected by the contract
BUpdate the contract to expect <code>emailAddress</code> instead of <code>email</code>
CIgnore the field mismatch and pass the test anyway
DRemove the <code>email</code> field from the contract test
Step-by-Step Solution
Solution:
  1. Step 1: Identify contract responsibility

    The contract defines the expected data format; the provider must follow it.
  2. Step 2: Choose the correct fix

    Changing the provider to return email matches the contract, ensuring stable integration.
  3. Final Answer:

    Change the provider to return email as expected by the contract -> Option A
  4. Quick Check:

    Provider must match contract fields [OK]
Quick Trick: Provider must match contract fields exactly [OK]
Common Mistakes:
MISTAKES
  • Ignoring field name mismatches
  • Changing contract to fit provider without agreement
  • Removing important fields from contract

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes