Testing RAP Business Objects: EML Scenario Tests, Behavior Test Doubles and Draft
Course quiz
Testing RAP Business Objects: EML Scenario Tests, Behavior Test Doubles and Draft
Keep this: job aid
RAP BO test checklist
- Test map first: every validation, determination, action, feature rule, authorization rule and draft path has a named test and layer.
- Scenario class: "! @testing BDEF:..., FOR TESTING RISK LEVEL HARMLESS DURATION SHORT, CDS and SQL doubles in class_setup.
- setup: clear_doubles and insert only the rows the test needs; teardown: ROLLBACK ENTITIES; class_teardown: destroy.
- Assert twice: after MODIFY ENTITIES (failed, mapped) and after COMMIT ENTITIES (sy-subrc 0/4/8, failed, reported).
- Handler tests: test class as FRIENDS, CREATE OBJECT cut FOR TESTING, LATE responses for validations, EARLY for actions.
- Doubles: CL_BOTD_TXBUFDBL_BO_TEST_ENV for the BO's own handlers; CL_BOTD_MOCKEMLAPI_BO_TEST_ENV for consumers; CL_CDS_TEST_ENVIRONMENT for view logic.
- Draft: create with %is_draft on, Prepare, failed Activate keeps the draft, fix, Activate; use %tky in handlers; check state messages clear.
- Late numbering: inject the number source; assert inside COMMIT ENTITIES BEGIN ... CONVERT KEY ... END.
- Rules that block users: GET PERMISSIONS, CL_AUNIT_AUTHORITY_CHECK restrictions, no IN LOCAL MODE in proofs, message class/number/element.
- Gate: ATC with ABAP Unit on release, RS_AUCV_RUNNER nightly, coverage as questions, evidence in SAP Cloud ALM.