method get_message.
data: message type bapiret2-message,
return type bapiret2.
call function 'BAPI_MESSAGE_GETDETAIL'
exporting
id = '00'
number = 000
textformat = 'HTM'
importing
message = message
return = return.
result = message.
endmethod.
if_ftd_invocation_answer
instead of just calling create_input_configuration
.me
as the answering object, thus:class ltc_test definition final for testing
duration short
risk level harmless.
public section.
interfaces if_ftd_invocation_answer.
private section.
constants mock_text type string value `The moon is made of green cheese`.
methods fm_is_mocked for testing raising cx_static_check.
endclass.
class ltc_test implementation.
method fm_is_mocked.
data(function_double) = cl_function_test_environment=>create(
value #( ( 'BAPI_MESSAGE_GETDETAIL' ) ) )->get_double( 'BAPI_MESSAGE_GETDETAIL' ).
function_double->configure_call( )->ignore_all_parameters( )->then_answer( me ).
cl_abap_unit_assert=>assert_equals( act = new zcl_message( )->get_message( )
exp = mock_text ).
endmethod.
method if_ftd_invocation_answer~answer.
result->get_output_configuration( )->set_exporting_parameter( name = 'MESSAGE'
value = mock_text ).
endmethod.
endclass.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |