Skip to Content

How to double a methode in Unit-Test

Feb 20 at 08:29 AM


avatar image


i want to test a Methode that calls a provate Methode of the same class. This provate Methode i want to double, using the double Framework.

The Problem i face is, how to tell SAP to use the doubled Methode?

Can anybod help me?

What i got so far is:

DATA: lo_double TYPE REF TO z_cl_double.

lo_double ?= cl_abap_testdouble=>create( 'Z_IF_ADAPTER' ).

cl_abap_testdouble=>configure_call( lo_double )->returning( '10' )->ignore_all_parameters( ).
lo_double->b( ).

But how to tell my class to use the doubled Methode?

Thanks a lot,


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers