AtsMec_WlanInformationAPI_TestCases.ttcn 96.7 KB
Newer Older
 *    @author   ETSI / TTF T012 / TTF T027
 *    @version  $URL:$
 *              $ID:$
 *    @desc     This module provides the MEC test cases.
 *    @copyright   ETSI Copyright Notification
 *                 No part may be reproduced except as authorized by written permission.
 *                 The copyright and the foregoing restriction extend to reproduction in all media.
 *                 All rights reserved.
 *    @see      ETSI GS MEC 002, Draft ETSI GS MEC 028 V2.3.1 (2022-07)
YannGarcia's avatar
YannGarcia committed
module AtsMec_WlanInformationAPI_TestCases {


  // Libcommon
  import from LibCommon_Time all;
  import from LibCommon_VerdictControl all;
  import from LibCommon_Sync all;

  // LibHttp
  import from LibHttp_TypesAndValues all;
  import from LibHttp_Functions all;
  import from LibHttp_Templates all;
  import from LibHttp_JsonTemplates all;
  import from LibHttp_TestSystem all;

  // LibMec/WlanInformationAPI
  import from WlanInformationAPI_TypesAndValues all;
  import from WlanInformationAPI_Pics all;
  import from WlanInformationAPI_Pixits all;
  import from WlanInformationAPI_Templates all;
  import from WlanInformationAPI_Functions all;

  // LibMec
  import from LibMec_Templates all;
  import from LibMec_Functions all;
  import from LibMec_Pics all;
  import from LibMec_Pixits all;

  group me_app_role {

    /**
     * @desc Check that the IUT responds with the list of WLAN Access Point
     */
    testcase TC_MEC_MEC028_SRV_WAI_001_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      var HttpMessage v_response;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
          log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
          setverdict(inconc);
          stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                    m_http_request_get(
                                                      PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/ap/ap_information",
                                                      v_headers
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                              mw_http_response_ok(
                                                                  mw_http_message_body_json(
                                                                                            mw_body_json_ap_info_list
                            )))) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of ApInfo ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_001_OK
     * @desc Check that the IUT responds with the list of WLAN Access Point filtered by the macId provided as query parameter
    testcase TC_MEC_MEC028_SRV_WAI_002_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
          log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
          setverdict(inconc);
          stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                    m_http_request_get(
                                                      PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/ap/ap_information?filter=(eq," & PX_WLAN_FILTER_FIELD & "," & PX_WLAN_FILTER_VALUE & ")",
                                                      v_headers
                    )));
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                              mw_http_response_ok(
                                                                  mw_http_message_body_json(
                                                                                            mw_body_json_ap_info_list
                            )))) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of ApInfo ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_002_OK

    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
    testcase TC_MEC_MEC028_SRV_WAI_002_BR() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
          log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
          setverdict(inconc);
          stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                    m_http_request_get(
                                                      PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/apId/ap_information?filter=(ee," & PX_WLAN_FILTER_FIELD & "," & PX_WLAN_FILTER_VALUE & ")", // Invalid requery
                                                      v_headers
                    )));
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                              mw_http_response_400_bad_request
                            )) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_002_BR

    /**
     * @desc Check that the IUT responds with the list of Station Point
     */
    testcase TC_MEC_MEC028_SRV_WAI_003_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
          log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
          setverdict(inconc);
          stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                    m_http_request_get(
                                                      PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/sta/sta_information",
                                                      v_headers
                    )));
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                              mw_http_response_ok(
                                                                  mw_http_message_body_json(
                                                                                            mw_body_json_sta_info_list
                            )))) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a StaInfo list ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_003_OK

    /**
     * @desc Check that the IUT responds with the list of Station Point filtered by the macId provided as query parameter
     */
    testcase TC_MEC_MEC028_SRV_WAI_004_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
          log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
          setverdict(inconc);
          stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                    m_http_request_get(
                                                      PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/sta/sta_information?filter=(eq," & PX_WLAN_FILTER_FIELD & "," & PX_WLAN_FILTER_VALUE & ")",
                                                      v_headers
                    )));
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                              mw_http_response_ok(
                                                                  mw_http_message_body_json(
                                                                                            mw_body_json_sta_info_list
                            )))) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a StaInfo list ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_004_OK

    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
    testcase TC_MEC_MEC028_SRV_WAI_004_BR() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
          log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
          setverdict(inconc);
          stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                    m_http_request_get(
                                                      PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/staId/sta_information?filter=(ee," & PX_WLAN_FILTER_FIELD & "," & PX_WLAN_FILTER_VALUE & ")", // Invalid requery
                                                      v_headers
                    )));
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                              mw_http_response_400_bad_request
                            )) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_004_BR

    /**
     * @desc Check that the IUT responds with the requested list of subscription
     */
    testcase TC_MEC_MEC028_SRV_WAI_005_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      var AssocStaSubscription v_assoc_sta_subscription, v_assoc_sta_subscription_1;
      var Json.String v_subscription_id, v_subscription_id_1;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
          log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
          setverdict(inconc);
          stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_create_assoc_sta_subscription(v_assoc_sta_subscription, v_subscription_id);
      f_create_assoc_sta_subscription(v_assoc_sta_subscription, v_subscription_id_1);
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                    m_http_request_get(
                                                      PICS_ROOT_API & PX_ME_WLAN_URI_SUB,
                                                      v_headers
                    )));
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                              mw_http_response_ok(
                                                                  mw_http_message_body_json(
                                                                                            mw_body_json_wlan_subscription_link_list(
                                                                                                                                    mw_subscription_link_list(
                                                                                                                                                              -,
                                                                                                                                                              {
                                                                                                                                                                *, 
                                                                                                                                                                mw_subscription(
                                                                                                                                                                                v_assoc_sta_subscription.links.self_.href,
                                                                                                                                                                                "AssocStaSubscription"
                                                                                                                                                                                ), 
                                                                                                                                                                mw_subscription(
                                                                                                                                                                                v_assoc_sta_subscription_1.links.self_.href,
                                                                                                                                                                                "AssocStaSubscription"
                                                                                                                                                                                ), *
                                                                                                                                                              }
                            )))))) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of subscription ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_delete_assoc_sta_subscription(v_subscription_id);
      f_delete_assoc_sta_subscription(v_subscription_id_1);
      f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_005_OK

    /**
     * @desc Check that the IUT responds with the requested list of subscription when the MEC Platform is queried using a filter on subscription type
     */
    testcase TC_MEC_MEC028_SRV_WAI_006_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      var AssocStaSubscription v_assoc_sta_subscription;
      var Json.String v_subscription_id
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
          log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
          setverdict(inconc);
          stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_create_assoc_sta_subscription(v_assoc_sta_subscription, v_subscription_id);
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get(
                                                      PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "subscription_type=assoc_sta",
                                                      v_headers
                    )));
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_ok(
                                                                 mw_http_message_body_json(
                                                                                           mw_body_json_wlan_subscription_link_list(
                                                                                                                                    mw_subscription_link_list(
                                                                                                                                                              -,
                                                                                                                                                              {
                                                                                                                                                                *, 
                                                                                                                                                                mw_subscription(
                                                                                                                                                                                v_assoc_sta_subscription.links.self_.href,
                                                                                                                                                                                "AssocStaSubscription"
                                                                                                                                                                                ), 
                                                                                                                                                                *
                                                                                                                                                              }
                            )))))) {
          tc_ac.stop;
            
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of AssocStaSubscription ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_delete_assoc_sta_subscription(v_subscription_id);
      f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_006_OK
    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
    testcase TC_MEC_MEC028_SRV_WAI_006_BR() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      var AssocStaSubscription v_assoc_sta_subscription;
      var Json.String v_subscription_id
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
          log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
          setverdict(inconc);
          stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_create_assoc_sta_subscription(v_assoc_sta_subscription, v_subscription_id);
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                    m_http_request_get(
                                                      PICS_ROOT_API & PX_ME_WLAN_URI & "/subscriptions/assoc_sta",
                                                      v_headers
                    )));
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                              mw_http_response_400_bad_request
                            )) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_delete_assoc_sta_subscription(v_subscription_id);
      f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_006_BR

    /**
     * @desc Check that the IUT responds with an error when a request with not existing parameters is sent
     */
    testcase TC_MEC_MEC028_SRV_WAI_006_NF() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
          log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
          setverdict(inconc);
          stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                    m_http_request_get(
                                                      PICS_ROOT_API & PX_ME_WLAN_URI_SUB,
                                                      v_headers
                                                      )
                                    )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                              mw_http_response_404_not_found
                                              )) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_006_NF

    /**
     * @desc Check that the IUT responds with a Notification Subscription
     */
    testcase TC_MEC_MEC028_SRV_WAI_007_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      var HttpMessage v_response;
      var Json.String v_subscription_id;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
          log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
          setverdict(inconc);
          stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                    m_http_request_post(
                                                        PICS_ROOT_API & PX_ME_WLAN_URI_SUB,
                                                        v_headers,
                                                        m_http_message_body_json(
                                                                                m_body_json_assoc_sta_subscription(
                                                                                                                    m_assoc_sta_subscription(
                                                                                                                                            PX_ASSOC_STA_SUBSCRIPTION_CALLBACK,
                                                                                                                                            m_ap_identity(
                                                                                                                                                          PX_MAC_ID
                                                                                                                                                          ),
                                                                                                                                            -, -, -,
                                                                                                                                            10, // notificationPeriod - Table 6.3.2-1: Attributes of the AssocStaSubscription Note 2
                                                                                                                                            -,
                                                                                                                                            m_time_stamp(
                                                                                                                                                          f_get_current_timestamp_utc() / 1000 + 30 // Expiry time: T + 30 seconds
                    )))))));
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                              mw_http_response_201_created(
                                                                          mw_http_message_body_json(
                                                                                                    mw_body_json_assoc_sta_subscription(
                                                                                                                                        mw_assoc_sta_subscription(
                                                                                                                                                                  PX_ASSOC_STA_SUBSCRIPTION_CALLBACK,
                                                                                                                                                                  -, -, -,
                                                                                                                                                                  ?
                            )))))) -> value v_response {
          tc_ac.stop;
          
          // Check HTTP Location header
          if (f_check_headers(v_response.response.header) == false) {
            log("*** " & testcasename() & ": FAIL: IUT failed in subscription  ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
          } else {
            var charstring_list v_header_location;
            f_get_header(v_response.response.header, "Location", v_header_location);
            v_subscription_id := regexp(
                                        v_header_location[0],
                                        "?+" & PX_ME_WLAN_URI_SUB & "/(?*)",
                                        0
                                        );

            log("*** " & testcasename() & ": PASS: IUT successfully responds to the subscription, SubscriptionId: ", v_subscription_id," ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
          }
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_delete_assoc_sta_subscription(v_subscription_id);
      f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_007_OK

    /**
     * @desc Check that the IUT responds with an error when an invalid Subscription request is sent
     */
    testcase TC_MEC_MEC028_SRV_WAI_007_BR() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
          log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
          setverdict(inconc);
          stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                    m_http_request_post(
                                                        PICS_ROOT_API & PX_ME_WLAN_URI_SUB,
                                                        v_headers,
                                                        m_http_message_body_json(
                                                                                m_body_json_assoc_sta_subscription(
                                                                                                                    m_assoc_sta_subscription_invalid(
                                                                                                                                                    PX_ASSOC_STA_SUBSCRIPTION_CALLBACK,
                                                                                                                                                    m_ap_identity(
                                                                                                                                                                  PX_MAC_ID
                    )))))));
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                              mw_http_response_400_bad_request
                            )) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_007_BR

    /**
     * @desc Check that the IUT responds with an error when a request with not existing parameters is sent
     */
    testcase TC_MEC_MEC028_SRV_WAI_007_NF() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
          log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
          setverdict(inconc);
          stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                    m_http_request_post(
                                                        PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "&filter=(eq,ap/macId,00:01:02:03:04:04)",
                                                        v_headers,
                                                        m_http_message_body_json(
                                                                                m_body_json_assoc_sta_subscription(
                                                                                                                    m_assoc_sta_subscription(
                                                                                                                                            PX_ASSOC_STA_SUBSCRIPTION_CALLBACK,
                                                                                                                                            m_ap_identity(
                                                                                                                                                          PX_MAC_ID
                    )))))));
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                              mw_http_response_404_not_found
                            )) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_007_NF

    /**
     * @desc Check that the IUT responds with the list of Subscription
     */
    testcase TC_MEC_MEC028_SRV_WAI_008_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      var AssocStaSubscription v_assoc_sta_subscription;
      var Json.String v_subscription_id;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
          log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
          setverdict(inconc);
          stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_create_assoc_sta_subscription(v_assoc_sta_subscription, v_subscription_id);
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get(
                                                      PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "/" & v_subscription_id,
                                                      v_headers
                    )));
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                              mw_http_response_ok(
                                                                  mw_http_message_body_json(
                                                                                            mw_body_json_assoc_sta_subscription(
                                                                                                                                mw_assoc_sta_subscription(
                                                                                                                                                              v_assoc_sta_subscription.callbackReference,
                                                                                                                                                              -,
                                                                                                                                                              -, -,
                                                                                                                                                              v_assoc_sta_subscription.links
                            )))))) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with an AssocStaSubscription ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_delete_assoc_sta_subscription(v_subscription_id);
      f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_008_OK

    /**
     * @desc Check that the IUT responds with an error when a request for existing subscription with incorrect parameters is sent
     */
    testcase TC_MEC_MEC028_SRV_WAI_008_NF() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get(
                                                      PICS_ROOT_API & PX_ME_WLAN_URI & "/subscriptions/unknown",
                                                      v_headers
                    )));
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_404_not_found
                            )) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with an AssocStaSubscription ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_008_NF

    /**
     * @desc Check that the IUT responds with a Notification Subscription when it is modified
     */
    testcase TC_MEC_MEC028_SRV_WAI_009_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      var AssocStaSubscription v_assoc_sta_subscription;
      var Json.String v_subscription_id;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_create_assoc_sta_subscription(v_assoc_sta_subscription, v_subscription_id);
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_put(
                                                      PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "/" & v_subscription_id,
                                                      v_headers,
                                                      m_http_message_body_json(
                                                                                m_body_json_assoc_sta_subscription(
                                                                                                                  m_assoc_sta_subscription(
                                                                                                                                            v_assoc_sta_subscription.callbackReference,
                                                                                                                                            m_ap_identity(
                                                                                                                                                          PX_MAC_ID
                                                                                                                                                          ),
                                                                                                                                            -, -,
                                                                                                                                            v_assoc_sta_subscription.links,
                                                                                                                                            12,
                                                                                                                                            m_time_stamp(
                                                                                                                                                        f_get_current_timestamp_utc() / 1000 + 30 // Expiry time: T + 30 seconds
                    )))))));
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                              mw_http_response_ok(
                                                                  mw_http_message_body_json(
                                                                                            mw_body_json_assoc_sta_subscription(
                                                                                                                                mw_assoc_sta_subscription(
                                                                                                                                                          v_assoc_sta_subscription.callbackReference,
                                                                                                                                                          ?,
                                                                                                                                                          -, -,
                                                                                                                                                          v_assoc_sta_subscription.links
                            )))))) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds to the AssocStatSubscription update ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_delete_assoc_sta_subscription(v_subscription_id);
      f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_009_OK

    /**
     * @desc Check that the IUT responds with an error when an invalid field is set in the subscription modification request 
     */
    testcase TC_MEC_MEC028_SRV_WAI_009_BR() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var Headers v_headers;
      var AssocStaSubscription v_assoc_sta_subscription;
      var Json.String v_subscription_id;