العقود الموجّهة بالمستهلك
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
write a contract from the consumer's needs.
الموضوعات المخطط لها
- The consumer states what it uses from the provider: request and the response fields it reads.
- The contract is a file (Pact JSON, or a Spring Cloud Contract definition) generated from consumer tests.
- The provider verifies it against the real provider code, with no consumer running.
- Match only what the consumer needs (types, required fields), not the whole payload.
- Both sides review the contract; writing it from the provider alone defeats the point.
تفاصيل المخطط المبدئي
عرض عملي
orders (consumer) expects GET /stock/{sku} returns {sku: string, available: integer}; the Pact file records exactly that.
اختبر فهمك
Who writes the contract's expectations?
أظهر الإجابة
The consumer, from what it actually uses.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.