All files / src/objects zcl_abapgit_object_intf.clas.testclasses.abap

98.57% Statements 485/492
100% Branches 13/13
65% Functions 13/20
98.57% Lines 485/492

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 4931x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x   1x 1x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
CLASS ltcl_unit_test DEFINITION DEFERRED.
CLASS zcl_abapgit_object_intf DEFINITION LOCAL FRIENDS ltcl_unit_test.
 
CLASS lth_oo_object_fnc DEFINITION FINAL FOR TESTING.
 
  PUBLIC SECTION.
    INTERFACES zif_abapgit_oo_object_fnc.
 
    DATA:
      mv_create_package     TYPE devclass,
      ms_create_vseointerf  TYPE vseointerf,
      ms_deserialize_key    TYPE seoclskey,
      mt_deserialize_source TYPE zif_abapgit_definitions=>ty_string_tt,
      ms_descriptions_key   TYPE seoclskey,
      mt_descriptions       TYPE zif_abapgit_oo_object_fnc=>ty_seocompotx_tt,
      ms_activation_item    TYPE zif_abapgit_definitions=>ty_item,
      mt_docu_lines         TYPE tlinetab,
      mv_docu_id            TYPE dokhl-id,
      mv_docu_object_name   TYPE dokhl-object,
      mv_docu_langu         TYPE spras.
ENDCLASS.
 
CLASS lth_oo_object_fnc IMPLEMENTATION.
 
  METHOD zif_abapgit_oo_object_fnc~add_to_activation_list.
    ms_activation_item = is_item.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~create.
    mv_create_package    = iv_package.
    ms_create_vseointerf = cg_properties.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~create_documentation.
    mt_docu_lines       = it_lines.
    mv_docu_id          = iv_id.
    mv_docu_object_name = iv_object_name.
    mv_docu_langu       = iv_language.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~create_sotr.
  ENDMETHOD.
  METHOD zif_abapgit_oo_object_fnc~delete.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~delete_documentation.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~deserialize_source.
    ms_deserialize_key    = is_key.
    mt_deserialize_source = it_source.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~exists.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~generate_locals.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~get_class_properties.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~get_includes.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~get_interface_properties.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~get_skip_test_classes.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~insert_text_pool.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~read_attributes.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~read_descriptions_class.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~read_descriptions_compo.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~read_descriptions_subco.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~read_documentation.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~read_sotr.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~read_superclass.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~read_text_pool.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~serialize_abap.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~update_descriptions_class.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~update_descriptions_compo.
    ms_descriptions_key = is_key.
    mt_descriptions     = it_descriptions.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~update_descriptions_subco.
  ENDMETHOD.
 
  METHOD zif_abapgit_oo_object_fnc~syntax_check.
  ENDMETHOD.
 
ENDCLASS.
 
 
CLASS ltcl_unit_test DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
 
  PRIVATE SECTION.
    DATA:
      mo_cut        TYPE REF TO zif_abapgit_object,
      mo_files      TYPE REF TO zcl_abapgit_objects_files,
      mo_log        TYPE REF TO zcl_abapgit_log,
      mo_object_fnc TYPE REF TO lth_oo_object_fnc,
      ms_item       TYPE zif_abapgit_definitions=>ty_item.
 
    METHODS:
      setup RAISING zcx_abapgit_exception,
 
      get_xml
        RETURNING VALUE(rv_xml) TYPE string,
      get_source
        RETURNING VALUE(rt_source) TYPE rswsourcet,
 
      deserializes FOR TESTING RAISING cx_static_check.
ENDCLASS.
 
CLASS ltcl_unit_test IMPLEMENTATION.
 
  METHOD setup.
    DATA lo_cut TYPE REF TO zcl_abapgit_object_intf.
 
    ms_item-obj_name = 'ZIF_ABAPGIT_TEST_INTF'.
    ms_item-obj_type = 'INTF'.
    ms_item-abap_language_version = zif_abapgit_aff_types_v1=>co_abap_language_version_src-standard.
 
    mo_files = zcl_abapgit_objects_files=>new( ms_item ).
 
    CREATE OBJECT lo_cut
      EXPORTING
        is_item     = ms_item
        iv_language = 'E'
        io_files    = mo_files.
 
    CREATE OBJECT mo_log.
 
    CREATE OBJECT mo_object_fnc.
    lo_cut->mi_object_oriented_object_fct  = mo_object_fnc.
 
    mo_cut = lo_cut.
 
  ENDMETHOD.
 
  METHOD deserializes.
    DATA lo_xmlin TYPE REF TO zcl_abapgit_xml_input.
    DATA ls_expected_vseointerf TYPE vseointerf.
    DATA ls_expected_clskey TYPE seoclskey.
    DATA ls_expected_description TYPE seocompotx.
    DATA lt_expected_descriptions TYPE zif_abapgit_oo_object_fnc=>ty_seocompotx_tt.
    DATA ls_expected_docu_line TYPE tline.
    DATA lt_expected_docu_lines TYPE tlinetab.
 
    CREATE OBJECT lo_xmlin TYPE zcl_abapgit_xml_input
      EXPORTING
        iv_xml = get_xml( ).
 
    mo_files->add_abap( get_source( ) ).
 
    mo_cut->deserialize(
      iv_package   = 'MY_PACKAGE'
      io_xml       = lo_xmlin
      iv_step      = zif_abapgit_object=>gc_step_id-abap
      ii_log       = mo_log
      iv_transport = 'XXX12345678' ).
 
 
    cl_abap_unit_assert=>assert_equals( exp = 'MY_PACKAGE'
                                        act = mo_object_fnc->mv_create_package ).
 
    ls_expected_vseointerf-clsname = 'ZIF_ABAPGIT_TEST_INTF'.
    ls_expected_vseointerf-langu = 'E'.
    ls_expected_vseointerf-descript = 'Test interface for abap git'.
    ls_expected_vseointerf-exposure = '2'.
    ls_expected_vseointerf-state = '1'.
    ls_expected_vseointerf-unicode = zif_abapgit_aff_types_v1=>co_abap_language_version_src-standard.
    cl_abap_unit_assert=>assert_equals( exp = ls_expected_vseointerf
                                        act = mo_object_fnc->ms_create_vseointerf ).
 
    ls_expected_clskey-clsname = 'ZIF_ABAPGIT_TEST_INTF'.
    cl_abap_unit_assert=>assert_equals( exp = ls_expected_clskey
                                        act = mo_object_fnc->ms_deserialize_key ).
 
    cl_abap_unit_assert=>assert_equals( exp = ls_expected_clskey
                                        act = mo_object_fnc->ms_descriptions_key ).
    ls_expected_description-clsname = 'ZIF_ABAPGIT_TEST_INTF'.
    ls_expected_description-cmpname = 'ONE_METHOD'.
    ls_expected_description-langu = 'E'.
    ls_expected_description-descript = 'Method One, one, one, one, ...'.
    APPEND ls_expected_description TO lt_expected_descriptions.
    cl_abap_unit_assert=>assert_equals( exp = lt_expected_descriptions
                                        act = mo_object_fnc->mt_descriptions ).
    cl_abap_unit_assert=>assert_equals( exp = ms_item
                                        act = mo_object_fnc->ms_activation_item ).
 
    ls_expected_docu_line-tdformat = 'U1'.
    ls_expected_docu_line-tdline = '&MEANING&'.
    APPEND ls_expected_docu_line TO lt_expected_docu_lines.
    ls_expected_docu_line-tdformat = 'AS'.
    ls_expected_docu_line-tdline = 'Interface for abap git unit tests.'.
    APPEND ls_expected_docu_line TO lt_expected_docu_lines.
    cl_abap_unit_assert=>assert_equals( exp = lt_expected_docu_lines
                                        act = mo_object_fnc->mt_docu_lines ).
    cl_abap_unit_assert=>assert_equals( exp = 'IF'
                                        act = mo_object_fnc->mv_docu_id ).
    cl_abap_unit_assert=>assert_equals( exp = 'E'
                                        act = mo_object_fnc->mv_docu_langu ).
    cl_abap_unit_assert=>assert_equals( exp = 'ZIF_ABAPGIT_TEST_INTF'
                                        act = mo_object_fnc->mv_docu_object_name ).
  ENDMETHOD.
 
  METHOD get_xml.
    rv_xml =
    '<?xml version="1.0" encoding="UTF-8"?><abapGit version="v1.0.0">' &&
    '  <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">' &&
    '    <asx:values>' &&
    '      <VSEOINTERF>' &&
    '        <CLSNAME>ZIF_ABAPGIT_TEST_INTF</CLSNAME>' &&
    '        <LANGU>E</LANGU>' &&
    '        <DESCRIPT>Test interface for abap git</DESCRIPT>' &&
    '        <EXPOSURE>2</EXPOSURE>' &&
    '        <STATE>1</STATE>' &&
    '        <UNICODE>' && zif_abapgit_aff_types_v1=>co_abap_language_version_src-standard && '</UNICODE>' &&
    '      </VSEOINTERF>' &&
    '      <DESCRIPTIONS>' &&
    '        <SEOCOMPOTX>' &&
    '          <CLSNAME>ZIF_ABAPGIT_TEST_INTF</CLSNAME>' &&
    '          <CMPNAME>ONE_METHOD</CMPNAME>' &&
    '          <LANGU>E</LANGU>' &&
    '          <DESCRIPT>Method One, one, one, one, ...</DESCRIPT>' &&
    '        </SEOCOMPOTX>' &&
    '      </DESCRIPTIONS>' &&
    '      <LINES>' &&
    '        <TLINE>' &&
    '          <TDFORMAT>U1</TDFORMAT>' &&
    '          <TDLINE>&amp;MEANING&amp;</TDLINE>' &&
    '        </TLINE>' &&
    '        <TLINE>' &&
    '          <TDFORMAT>AS</TDFORMAT>' &&
    '          <TDLINE>Interface for abap git unit tests.</TDLINE>' &&
    '        </TLINE>' &&
    '      </LINES>' &&
    '    </asx:values>' &&
    '  </asx:abap>' &&
    '</abapGit>'.
  ENDMETHOD.
 
  METHOD get_source.
    APPEND 'interface zif_abapgit_test_intf' TO rt_source.
    APPEND '  public.' TO rt_source.
    APPEND '  methods:' TO rt_source.
    APPEND '    one_method' TO rt_source.
    APPEND '      returning value(rv_value) type string.' TO rt_source.
    APPEND '' TO rt_source.
    APPEND 'endinterface.' TO rt_source.
  ENDMETHOD.
 
ENDCLASS.
 
CLASS ltcl_aff_metadata DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
  PRIVATE SECTION.
    METHODS:
      deserialize_defaults FOR TESTING RAISING cx_static_check,
      deserialize_non_defaults FOR TESTING RAISING cx_static_check,
      serialize_non_default FOR TESTING RAISING cx_static_check,
      serialize_default FOR TESTING RAISING cx_static_check.
 
ENDCLASS.
 
 
CLASS ltcl_aff_metadata IMPLEMENTATION.
 
  METHOD serialize_default.
    DATA:
      lv_expected        TYPE string,
      lv_actual          TYPE string,
      lv_serialized_data TYPE xstring,
      lv_is_equal        TYPE abap_bool,
      ls_intf            TYPE zcl_abapgit_object_intf=>ty_intf.
 
    ls_intf-vseointerf-unicode = zif_abapgit_aff_types_v1=>co_abap_language_version_src-standard.
    ls_intf-vseointerf-descript = `abc`.
    ls_intf-vseointerf-langu = `E`.
    ls_intf-vseointerf-category = zif_abapgit_aff_intf_v1=>co_category-general.
    ls_intf-vseointerf-clsproxy = abap_false.
 
    lv_serialized_data = lcl_aff_metadata_handler=>serialize( ls_intf ).
 
    lv_expected =
      `{` && cl_abap_char_utilities=>newline &&
      `  "formatVersion": "1",` && cl_abap_char_utilities=>newline &&
      `  "header": {` && cl_abap_char_utilities=>newline &&
      `    "description": "abc",` && cl_abap_char_utilities=>newline &&
      `    "originalLanguage": "en"` && cl_abap_char_utilities=>newline &&
      `  }` && cl_abap_char_utilities=>newline &&
      `}` && cl_abap_char_utilities=>newline.
 
    lv_actual = cl_abap_codepage=>convert_from( lv_serialized_data ).
 
    lv_is_equal = zcl_abapgit_ajson_utilities=>new( )->is_equal(
      iv_json_a = lv_actual
      iv_json_b = lv_expected ).
    cl_abap_unit_assert=>assert_equals(
      act = lv_is_equal
      exp = abap_true ).
  ENDMETHOD.
 
 
  METHOD serialize_non_default.
    DATA:
      lv_expected        TYPE string,
      lv_actual          TYPE string,
      lv_serialized_data TYPE xstring,
      lv_is_equal        TYPE abap_bool,
      ls_intf            TYPE zcl_abapgit_object_intf=>ty_intf.
 
    ls_intf-vseointerf-unicode = zif_abapgit_aff_types_v1=>co_abap_language_version_src-key_user.
    ls_intf-vseointerf-descript = `abc`.
    ls_intf-vseointerf-langu = `d`.
    ls_intf-vseointerf-category = zif_abapgit_aff_intf_v1=>co_category-db_procedure_proxy.
    ls_intf-vseointerf-clsproxy = abap_true.
 
    lv_serialized_data = lcl_aff_metadata_handler=>serialize( ls_intf ).
 
    lv_expected =
      `{` && cl_abap_char_utilities=>newline &&
      `  "formatVersion": "1",` && cl_abap_char_utilities=>newline &&
      `  "header": {` && cl_abap_char_utilities=>newline &&
      `    "description": "abc",` && cl_abap_char_utilities=>newline &&
      `    "originalLanguage": "sr-Latn",` && cl_abap_char_utilities=>newline &&
      `    "abapLanguageVersion": "` && zif_abapgit_dot_abapgit=>c_abap_language_version-key_user && `"`
        && cl_abap_char_utilities=>newline &&
      `  },` && cl_abap_char_utilities=>newline &&
      `  "category": "dbProcedureProxy",` && cl_abap_char_utilities=>newline &&
      `  "proxy": true` && cl_abap_char_utilities=>newline &&
      `}` && cl_abap_char_utilities=>newline.
 
    lv_actual = cl_abap_codepage=>convert_from( lv_serialized_data ).
 
    lv_is_equal = zcl_abapgit_ajson_utilities=>new( )->is_equal(
      iv_json_a = lv_actual
      iv_json_b = lv_expected ).
    cl_abap_unit_assert=>assert_equals(
      act = lv_is_equal
      exp = abap_true ).
  ENDMETHOD.
 
  METHOD deserialize_non_defaults.
    DATA:
      lv_source                  TYPE string,
      ls_description_type        TYPE zif_abapgit_aff_oo_types_v1=>ty_component_description,
      ls_description_attr        TYPE zif_abapgit_aff_oo_types_v1=>ty_component_description,
      ls_description_meth_param  TYPE zif_abapgit_aff_oo_types_v1=>ty_component_description,
      ls_description_meth_params TYPE zif_abapgit_aff_oo_types_v1=>ty_component_descriptions,
      ls_description_even        TYPE zif_abapgit_aff_oo_types_v1=>ty_event,
      ls_description_meth        TYPE zif_abapgit_aff_oo_types_v1=>ty_method,
      ls_actual                  TYPE zif_abapgit_aff_intf_v1=>ty_main,
      ls_expected                TYPE zif_abapgit_aff_intf_v1=>ty_main.
 
 
    ls_expected-format_version = `1`.
    ls_expected-header-description = 'abc'.
    ls_expected-header-original_language = 'M'. " SAP1 Language Code for Chinese (Taiwan)
    ls_expected-header-abap_language_version = zif_abapgit_aff_types_v1=>co_abap_language_version_src-key_user.
    ls_expected-category = zif_abapgit_aff_intf_v1=>co_category-db_procedure_proxy.
    ls_expected-proxy = abap_true.
 
    ls_description_type-name = 'TY_EXAMPLE_TYPE'.
    ls_description_type-description = 'This is an example type'.
    APPEND ls_description_type TO ls_expected-descriptions-types.
 
    ls_description_attr-name = 'CO_EXAMPLE_CONSTANT'.
    ls_description_attr-description = 'This is an example constant'.
    APPEND ls_description_attr TO ls_expected-descriptions-attributes.
 
    ls_description_even-name = 'EXAMPLE_EVENT'.
    ls_description_even-description = 'This is an example event'.
    APPEND ls_description_even TO ls_expected-descriptions-events.
 
    ls_description_meth_param-name = 'I_PARAM'.
    ls_description_meth_param-description = 'This is an example parameter'.
    APPEND ls_description_meth_param TO ls_description_meth_params.
 
    ls_description_meth-name = 'EXAMPLE_METHOD'.
    ls_description_meth-description = 'This is an example method'.
    ls_description_meth-parameters = ls_description_meth_params.
    APPEND ls_description_meth TO ls_expected-descriptions-methods.
 
    lv_source =
      `{` && cl_abap_char_utilities=>newline &&
      `  "formatVersion": "1",` && cl_abap_char_utilities=>newline &&
      `  "header": {` && cl_abap_char_utilities=>newline &&
      `    "description": "abc",` && cl_abap_char_utilities=>newline &&
      `    "originalLanguage": "zh-Hant",` && cl_abap_char_utilities=>newline &&
      `    "abapLanguageVersion": "` && zif_abapgit_dot_abapgit=>c_abap_language_version-key_user && `"`
        && cl_abap_char_utilities=>newline &&
      `  },` && cl_abap_char_utilities=>newline &&
      `  "category": "dbProcedureProxy",` && cl_abap_char_utilities=>newline &&
      `  "proxy": true,` && cl_abap_char_utilities=>newline &&
      `  "descriptions": {` && cl_abap_char_utilities=>newline &&
      `    "types": [` && cl_abap_char_utilities=>newline &&
      `      {` && cl_abap_char_utilities=>newline &&
      `        "name": "TY_EXAMPLE_TYPE",` && cl_abap_char_utilities=>newline &&
      `        "description": "This is an example type"` && cl_abap_char_utilities=>newline &&
      `      }` && cl_abap_char_utilities=>newline &&
      `    ],` && cl_abap_char_utilities=>newline &&
      `    "attributes": [` && cl_abap_char_utilities=>newline &&
      `      {` && cl_abap_char_utilities=>newline &&
      `        "name": "CO_EXAMPLE_CONSTANT",` && cl_abap_char_utilities=>newline &&
      `        "description": "This is an example constant"` && cl_abap_char_utilities=>newline &&
      `      }` && cl_abap_char_utilities=>newline &&
      `    ],` && cl_abap_char_utilities=>newline &&
      `    "events": [` && cl_abap_char_utilities=>newline &&
      `      {` && cl_abap_char_utilities=>newline &&
      `        "name": "EXAMPLE_EVENT",` && cl_abap_char_utilities=>newline &&
      `        "description": "This is an example event"` && cl_abap_char_utilities=>newline &&
      `      }` && cl_abap_char_utilities=>newline &&
      `    ],` && cl_abap_char_utilities=>newline &&
      `    "methods": [` && cl_abap_char_utilities=>newline &&
      `      {` && cl_abap_char_utilities=>newline &&
      `        "name": "EXAMPLE_METHOD",` && cl_abap_char_utilities=>newline &&
      `        "description": "This is an example method",` && cl_abap_char_utilities=>newline &&
      `        "parameters": [` && cl_abap_char_utilities=>newline &&
      `          {` && cl_abap_char_utilities=>newline &&
      `            "name": "I_PARAM",` && cl_abap_char_utilities=>newline &&
      `            "description": "This is an example parameter"` && cl_abap_char_utilities=>newline &&
      `          }` && cl_abap_char_utilities=>newline &&
      `        ]` && cl_abap_char_utilities=>newline &&
      `      }` && cl_abap_char_utilities=>newline &&
      `    ]` && cl_abap_char_utilities=>newline &&
      `  }` && cl_abap_char_utilities=>newline &&
      `}` && cl_abap_char_utilities=>newline.
 
    " cut
    ls_actual = lcl_aff_metadata_handler=>deserialize( lv_source ).
 
    cl_abap_unit_assert=>assert_equals( act = ls_actual
                                        exp = ls_expected ).
  ENDMETHOD.
 
  METHOD deserialize_defaults.
    DATA:
      lv_source         TYPE string,
      ls_actual         TYPE zif_abapgit_aff_intf_v1=>ty_main,
      ls_expected       TYPE zif_abapgit_aff_intf_v1=>ty_main.
 
 
    ls_expected-format_version = `1`.
    ls_expected-header-description = 'abc'.
    ls_expected-header-original_language = 'F'.
    ls_expected-header-abap_language_version = zif_abapgit_aff_types_v1=>co_abap_language_version_src-standard.
    ls_expected-category = zif_abapgit_aff_intf_v1=>co_category-general.
    ls_expected-proxy = abap_false.
 
    lv_source =
      `{` && cl_abap_char_utilities=>newline &&
      `  "formatVersion": "1",` && cl_abap_char_utilities=>newline &&
      `  "header": {` && cl_abap_char_utilities=>newline &&
      `    "description": "abc",` && cl_abap_char_utilities=>newline &&
      `    "originalLanguage": "fr"` && cl_abap_char_utilities=>newline &&
      `  }` && cl_abap_char_utilities=>newline &&
      `}` && cl_abap_char_utilities=>newline.
 
    " cut
    ls_actual = lcl_aff_metadata_handler=>deserialize( lv_source ).
 
    cl_abap_unit_assert=>assert_equals( act = ls_actual
                                        exp = ls_expected ).
  ENDMETHOD.
 
ENDCLASS.