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 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 3x 3x 1x 1x 3x 3x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 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_login_manager DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL.
PRIVATE SECTION.
CONSTANTS: c_username TYPE string VALUE 'Aladdin',
c_password TYPE string VALUE 'OpenSesame'.
METHODS:
setup,
teardown,
encoding FOR TESTING RAISING zcx_abapgit_exception,
save FOR TESTING RAISING zcx_abapgit_exception,
same_server FOR TESTING RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS ltcl_login_manager IMPLEMENTATION.
METHOD setup.
zcl_abapgit_login_manager=>clear( ).
ENDMETHOD.
METHOD teardown.
zcl_abapgit_login_manager=>clear( ).
ENDMETHOD.
METHOD save.
CONSTANTS lc_uri TYPE string VALUE 'https://abapgit.org/foo/bar'.
CONSTANTS lc_auth TYPE string VALUE 'foobar'.
zcl_abapgit_login_manager=>save(
iv_uri = lc_uri
iv_authorization = lc_auth ).
cl_abap_unit_assert=>assert_equals(
act = zcl_abapgit_login_manager=>get( lc_uri )
exp = lc_auth ).
ENDMETHOD.
METHOD encoding.
DATA lv_auth TYPE string.
lv_auth = zcl_abapgit_login_manager=>set_basic(
iv_uri = 'https://github.com/abapGit/abapGit.git'
iv_username = c_username
iv_password = c_password ).
cl_abap_unit_assert=>assert_equals(
act = lv_auth
exp = 'Basic QWxhZGRpbjpPcGVuU2VzYW1l' ).
ENDMETHOD.
METHOD same_server.
CONSTANTS: lc_github1 TYPE string VALUE 'https://github.com/abapGit/abapGit.git',
lc_github2 TYPE string VALUE 'https://github.com/larshp/Foobar.git'.
DATA: lv_auth1 TYPE string,
lv_auth2 TYPE string.
zcl_abapgit_login_manager=>set_basic(
iv_uri = lc_github1
iv_username = c_username
iv_password = c_password ).
lv_auth1 = zcl_abapgit_login_manager=>load( lc_github1 ).
lv_auth2 = zcl_abapgit_login_manager=>load( lc_github2 ).
cl_abap_unit_assert=>assert_equals(
act = lv_auth1
exp = lv_auth2 ).
ENDMETHOD.
ENDCLASS.
|