File tree Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Original file line number Diff line number Diff line change 1+ " Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+ " SPDX-License-Identifier: Apache-2.0
13
24CLASS ltc_zcl_aws1_cpd_actions DEFINITION FOR TESTING
35 DURATION SHORT
46 RISK LEVEL HARMLESS .
57
68 PRIVATE SECTION .
7- DATA :
8- f_cut TYPE REF TO zcl_aws1_cpd_actions. "class under test
9+ CONSTANTS cv_pfl TYPE /aws1/rt_profile_id VALUE 'ZCODE_DEMO' .
10+ CONSTANTS cv_languagecode VALUE | EN | .
911
1012 METHODS : detectsentiment FOR TESTING .
1113ENDCLASS . "ltc_Zcl_Aws1_Cpd_Actions
@@ -14,12 +16,23 @@ ENDCLASS. "ltc_Zcl_Aws1_Cpd_Actions
1416CLASS ltc_zcl_aws1_cpd_actions IMPLEMENTATION .
1517
1618 METHOD detectsentiment .
17-
18-
19-
19+ DATA lo_output TYPE REF TO /aws1/cl_cpddetectsentimentrsp.
20+ DATA (lv_expected_output ) = | POSITIVE| .
21+
22+ ao_cpd_actions->detectsentiment(
23+ IMPORTING
24+ oo_result = lo_output ).
25+
26+ DATA (lv_found ) = abap_true .
27+ IF lo_output->has_sentiment() = abap_true .
28+ IF lo_output->get_sentiment() = lv_expected_output.
29+ lv_found = abap_true .
30+ ENDIF .
31+ ENDIF .
32+
33+ cl_abap_unit_assert=>assert_true(
34+ act = lv_found
35+ msg = | Sentiment detection failed| ).
2036 ENDMETHOD .
2137
22-
23-
24-
2538ENDCLASS .
You can’t perform that action at this time.
0 commit comments