- Static bundle checks (name length, seed type, reserved words, contract test classes, testclasses_file), local abaplint parser check before SAP, max_tokens, robust JSON parse - Runner: G2 for CDS views with parameters, contract_check detail in report - G0020 and G0013 fixed by review and revalidated (oracle 100, null 0) - Pilot results in docs/faz1-tasarim.md 11e; handover notes merged into CLAUDE.md and docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
49 lines
1.7 KiB
ABAP
49 lines
1.7 KiB
ABAP
CLASS {{p}}t20_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
|
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
PRIVATE SECTION.
|
|
CLASS-DATA go_env TYPE REF TO if_cds_test_environment.
|
|
CLASS-METHODS class_setup.
|
|
CLASS-METHODS class_teardown.
|
|
METHODS setup.
|
|
METHODS order_with_customer FOR TESTING.
|
|
METHODS order_without_customer FOR TESTING.
|
|
ENDCLASS.
|
|
|
|
|
|
CLASS {{p}}t20_test IMPLEMENTATION.
|
|
METHOD class_setup.
|
|
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_ORDER' ).
|
|
ENDMETHOD.
|
|
|
|
METHOD class_teardown.
|
|
go_env->destroy( ).
|
|
ENDMETHOD.
|
|
|
|
METHOD setup.
|
|
DATA lt_cust TYPE STANDARD TABLE OF {{p}}cust WITH EMPTY KEY.
|
|
DATA lt_ord TYPE STANDARD TABLE OF {{p}}ord WITH EMPTY KEY.
|
|
go_env->clear_doubles( ).
|
|
lt_cust = VALUE #(
|
|
( cust_id = 'C001' cust_name = 'Alpha' country = 'DE' ) ).
|
|
lt_ord = VALUE #(
|
|
( order_id = 'O1' cust_id = 'C001' order_date = '20250101' status = 'O' )
|
|
( order_id = 'O2' cust_id = 'C999' order_date = '20250102' status = 'O' )
|
|
( order_id = 'O3' cust_id = 'C001' order_date = '20250103' status = 'C' ) ).
|
|
go_env->insert_test_data( lt_cust ).
|
|
go_env->insert_test_data( lt_ord ).
|
|
ENDMETHOD.
|
|
|
|
METHOD order_with_customer.
|
|
SELECT SINGLE customer_name, country FROM {{p}}i_order
|
|
WHERE order_id = 'O1' INTO @DATA(ls_ord).
|
|
cl_abap_unit_assert=>assert_equals( exp = 'Alpha' act = ls_ord-customer_name ).
|
|
cl_abap_unit_assert=>assert_equals( exp = 'DE' act = ls_ord-country ).
|
|
ENDMETHOD.
|
|
|
|
METHOD order_without_customer.
|
|
SELECT SINGLE customer_name FROM {{p}}i_order
|
|
WHERE order_id = 'O2' INTO @DATA(lv_name).
|
|
cl_abap_unit_assert=>assert_initial( act = lv_name ).
|
|
ENDMETHOD.
|
|
ENDCLASS.
|