AtsMec_RnisAPI_TestCases.ttcn 57.7 KB
Newer Older
        tc_ac.start;
        alt {
          [] httpPort.receive(
                              mw_http_response(
                                               mw_http_response_404_not_found(
                                                                              mw_http_message_body_json(
                                                                                                        mw_body_json_rni_problem_details(
                                                                                                                                         mw_problem_details(
                                                                                                                                                            -, -, 404
                                                                                                                                                            )))))) {
            tc_ac.stop;
            
            log("*** " & testcasename() & ": PASS: IUT successfully responds with HTTP error 400 Bad Request ***");
            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_SRV_RNIS_019_NF
    
  } // End of group rnis_query_bi_bo
  
  group rnis_notifications {
    
    /**
     * @desc Check that the RNIS service sends an RNIS notification  about cell change if the RNIS service has an associated subscription and the event is generated
.
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BV.tplan2
     */
    testcase TC_MEC_SRV_RNIS_001_OK() runs on HttpComponent system HttpTestAdapter {
        // Local variables
        var HeaderLines v_headers;
        
        // Test control
        if (not(PICS_RNIS) or not(PICS_RNIS_NOTIFICATIONS)) {
            log("*** " & testcasename() & ": PICS_RNIS and PICS_RNIS_NOTIFICATIONS required for executing the TC ***");
            setverdict(inconc);
            stop;
        }
        
        // Test component configuration
        f_cf_01_http_notif_up();
        
        // Test adapter configuration
        
        // Preamble
        f_init_default_headers_list(-, -, v_headers);
        action("Trigger a cell change event");
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        
        // Test Body
        tc_wait.start;
        alt {
          [] httpPort_notif.receive(
                                    mw_http_request(
                                                    mw_http_request_post(
                                                                         -,
                                                                         -,
                                                                         mw_http_message_body_json(
                                                                                                   mw_body_json_cell_change_subscription(
                                                                                                                                         mw_cell_change_subscription(
                                                                                                                                                                     PX_CALLBACK_REFERENCE
                                                                                                                                                                     )))))) {
            tc_wait.stop;
            log("*** " & testcasename() & ": INFO: IUT successfully sends cell-change notification ***");
            
            // Send 204 No Content
            httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers)));
            
            log("*** " & testcasename() & ": PASS: IUT successfully sends cell-change notification ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
          }
          [] tc_wait.timeout {
            log("*** " & testcasename() & ": INCONC: Expected message not received ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
          }
        } // End of 'alt' statement
        
        // Postamble
        f_cf_01_http_notif_down();
    } // End of testcase TC_MEC_SRV_RNIS_001_OK
    
    
  } // End of group rnis_notifications 
  
Yann Garcia's avatar
Yann Garcia committed
} // End of module AtsMec_RnisAPI_TestCases