anchor.diff:      METHODS get_proxy_port
         RETURNING
           VALUE(rv_port) TYPE string.
  +    METHODS set_run_critical_tests
  +      IMPORTING
  +        iv_run TYPE abap_bool.
  +    METHODS
  +      get_run_critical_tests
  +        RETURNING VALUE(rv_run) TYPE abap_bool.
     PROTECTED SECTION.
   
     PRIVATE SECTION.
       DATA mv_proxy_url TYPE string.
       DATA mv_proxy_port TYPE string.
  +    DATA mv_run_critical_tests TYPE abap_bool.
   
   
   ENDCLASS.
  
positive.code:       iv_type       = 'SETTINGS'
        iv_value      = 'PROXY_PORT'
        iv_data       = io_settings->get_proxy_port( ) ).
    ENDMETHOD.
  
  
    METHOD read.
      CREATE OBJECT ro_settings.
      TRY.
          ro_settings->set_proxy_url(
  
negative.code: CLASS ltcl_persistence_settings IMPLEMENTATION.
    METHOD setup.
      CREATE OBJECT mo_persistence_settings.
      CREATE OBJECT mo_settings.
      clear_settings_database( ).
  
      "These tests may fail if you are locking the entries (e.g. the ZABAPGIT transaction is open)
    ENDMETHOD.
  
    METHOD modify_settings_proxy_url.
      DATA lv_proxy_url TYPE string.
  
      mo_settings->set_proxy_url( 'http://proxy' ).
  
      mo_persistence_settings->modify( mo_settings ).
  
      lv_proxy_url = lcl_app=>db( )->read(
        iv_type  = 'SETTINGS'
        iv_value = 'PROXY_URL' ).
  
      cl_abap_unit_assert=>assert_equals(
        act = lv_proxy_url
        exp = 'http://proxy' ).
    ENDMETHOD.
  
    METHOD modify_settings_proxy_port.
      DATA lv_proxy_port TYPE string.
      mo_settings->set_proxy_port( '8080' ).
  
      mo_persistence_settings->modify( mo_settings ).
  
      lv_proxy_port = lcl_app=>db( )->read(
        iv_type  = 'SETTINGS'
        iv_value = 'PROXY_PORT' ).
  
      cl_abap_unit_assert=>assert_equals(
        act = lv_proxy_port
        exp = '8080' ).
    ENDMETHOD.
  
    METHOD read_proxy_settings.
      lcl_app=>db( )->modify(
        iv_type       = 'SETTINGS'
        iv_value      = 'PROXY_URL'
        iv_data       = 'A_URL' ).
  
      lcl_app=>db( )->modify(
        iv_type       = 'SETTINGS'
        iv_value      = 'PROXY_PORT'
        iv_data       = '1000' ).
  
      mo_settings = mo_persistence_settings->read( ).
  
      cl_abap_unit_assert=>assert_equals(
        act = mo_settings->get_proxy_url( )
        exp = 'A_URL' ).
      cl_abap_unit_assert=>assert_equals(
        act = mo_settings->get_proxy_port( )
        exp = '1000' ).
    ENDMETHOD.
  
    METHOD read_not_found_port.
      mo_settings = mo_persistence_settings->read( ).
  
      cl_abap_unit_assert=>assert_equals(
        act = mo_settings->get_proxy_port( )
        exp = '' ).
    ENDMETHOD.
  
    METHOD read_not_found_url.
  
      mo_settings = mo_persistence_settings->read( ).
  
      cl_abap_unit_assert=>assert_equals(
        act = mo_settings->get_proxy_url( )
        exp = '' ).
    ENDMETHOD.
  
    METHOD modify_run_critical_tests.
      DATA lv_run_critical_tests TYPE abap_bool.
      mo_settings->set_run_critical_tests( abap_true ).
  
      mo_persistence_settings->modify( mo_settings ).
  
      lv_run_critical_tests = lcl_app=>db( )->read(
        iv_type  = 'SETTINGS'
        iv_value = 'CRIT_TESTS' ).
  
      cl_abap_unit_assert=>assert_equals(
        act = lv_run_critical_tests
        exp = abap_true ).
    ENDMETHOD.
  
    METHOD read_run_critical_tests.
      lcl_app=>db( )->modify(
        iv_type       = 'SETTINGS'
        iv_value      = 'CRIT_TESTS'
        iv_data       = 'X' ).
      mo_settings = mo_persistence_settings->read( ).
  
      cl_abap_unit_assert=>assert_equals(
        act = mo_settings->get_run_critical_tests( )
        exp = abap_true ).
    ENDMETHOD.
    METHOD read_not_found_critical_tests.
      mo_settings = mo_persistence_settings->read( ).
  
      cl_abap_unit_assert=>assert_equals(
        act = mo_settings->get_run_critical_tests( )
        exp = abap_false ).
    ENDMETHOD.
  
  
    METHOD clear_settings_database.
  
      TRY.
          lcl_app=>db( )->delete(
            iv_type       = 'SETTINGS'
            iv_value      = 'PROXY_URL' ).
        CATCH cx_static_check.
          "If entry didn't exist, that's okay
      ENDTRY.
      TRY.
          lcl_app=>db( )->delete(
            iv_type       = 'SETTINGS'
            iv_value      = 'PROXY_PORT' ).
        CATCH cx_static_check.
          "If entry didn't exist, that's okay
      ENDTRY.
      TRY.
          lcl_app=>db( )->delete(
            iv_type       = 'SETTINGS'
            iv_value      = 'CRIT_TESTS' ).
        CATCH cx_static_check.
          "If entry didn't exist, that's okay
      ENDTRY.
  
    ENDMETHOD.
  
  ENDCLASS.