اختبارات التطبيق الكامل
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
run the whole application and test it end to end.
الموضوعات المخطط لها
@SpringBootTeststarts the full context; withwebEnvironment = RANDOM_PORTit also starts the web server.- Flyway or Liquibase migrations run on the container database, so you test the real schema.
- Use
TestRestTemplateorWebTestClient; the next module adds REST Assured. - Keep the number of these tests small; each costs startup time.
- Cache the Spring context by keeping test configurations identical.
تفاصيل المخطط المبدئي
عرض عملي
a test that posts an order, then reads it back through the repository, with Flyway having created the tables.
اختبر فهمك
What does RANDOM_PORT avoid?
أظهر الإجابة
Port clashes when tests run in parallel or on a busy machine.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.