Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
MEC - Multi-access Edge Computing
MEC TTCN-3 Test Suite
Commits
b7a36f9f
Commit
b7a36f9f
authored
Jun 09, 2020
by
Yann Garcia
Browse files
Move ProblemDetails in LibMec
parent
002520df
Changes
28
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
144 additions
and
412 deletions
+144
-412
ccsrc/Protocols/Json/json_codec.cc
ccsrc/Protocols/Json/json_codec.cc
+12
-19
ttcn/AtsMec/AtsMec_Ams_TestCases.ttcn
ttcn/AtsMec/AtsMec_Ams_TestCases.ttcn
+15
-13
ttcn/AtsMec/AtsMec_AppEnablementAPI_TestCases.ttcn
ttcn/AtsMec/AtsMec_AppEnablementAPI_TestCases.ttcn
+21
-9
ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn
ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn
+2
-0
ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn
ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn
+42
-40
ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn
ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn
+19
-17
ttcn/LibMec/Ams/ttcn/Ams_Templates.ttcn
ttcn/LibMec/Ams/ttcn/Ams_Templates.ttcn
+0
-29
ttcn/LibMec/Ams/ttcn/Ams_TypesAndValues.ttcn
ttcn/LibMec/Ams/ttcn/Ams_TypesAndValues.ttcn
+0
-19
ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_Templates.ttcn
ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_Templates.ttcn
+32
-14
ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_TypesAndValues.ttcn
ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_TypesAndValues.ttcn
+0
-19
ttcn/LibMec/AppLCM/ttcn/AppLCM_TypesAndValues.ttcn
ttcn/LibMec/AppLCM/ttcn/AppLCM_TypesAndValues.ttcn
+0
-20
ttcn/LibMec/BwManagementAPI/ttcn/BwManagementAPI_Templates.ttcn
...ibMec/BwManagementAPI/ttcn/BwManagementAPI_Templates.ttcn
+0
-28
ttcn/LibMec/BwManagementAPI/ttcn/BwManagementAPI_TypesAndValues.ttcn
.../BwManagementAPI/ttcn/BwManagementAPI_TypesAndValues.ttcn
+0
-19
ttcn/LibMec/Grant/ttcn/Grant_Templates.ttcn
ttcn/LibMec/Grant/ttcn/Grant_Templates.ttcn
+0
-29
ttcn/LibMec/Grant/ttcn/Grant_TypesAndValues.ttcn
ttcn/LibMec/Grant/ttcn/Grant_TypesAndValues.ttcn
+0
-20
ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Templates.ttcn
ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Templates.ttcn
+1
-30
ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_TypesAndValues.ttcn
ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_TypesAndValues.ttcn
+0
-20
ttcn/LibMec/MepmPkgm/ttcn/MepmPkgm_TypesAndValues.ttcn
ttcn/LibMec/MepmPkgm/ttcn/MepmPkgm_TypesAndValues.ttcn
+0
-20
ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn
ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn
+0
-28
ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn
ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn
+0
-19
No files found.
ccsrc/Protocols/Json/json_codec.cc
View file @
b7a36f9f
...
...
@@ -35,23 +35,23 @@ int json_codec::encode (const LibItsHttp__JsonMessageBodyTypes::JsonBody& msg, O
}
else
if
(
msg
.
ischosen
(
LibItsHttp__JsonMessageBodyTypes
::
JsonBody
::
ALT_serviceInfo
))
{
const
AppEnablementAPI__TypesAndValues
::
ServiceInfo
&
service_info
=
msg
.
serviceInfo
();
service_info
.
encode
(
AppEnablementAPI__TypesAndValues
::
ServiceInfo_descr_
,
encoding_buffer
,
TTCN_EncDec
::
CT_JSON
);
data
=
char2oct
(
CHARSTRING
(
"{
\"
ServiceInfo
\"
: "
))
+
OCTETSTRING
(
encoding_buffer
.
get_len
(),
encoding_buffer
.
get_data
())
+
char2oct
(
CHARSTRING
(
"}"
));
data
=
/*
char2oct(CHARSTRING("{\"ServiceInfo\": ")) +
*/
OCTETSTRING
(
encoding_buffer
.
get_len
(),
encoding_buffer
.
get_data
())
/*
+ char2oct(CHARSTRING("}"))
*/
;
}
else
if
(
msg
.
ischosen
(
LibItsHttp__JsonMessageBodyTypes
::
JsonBody
::
ALT_appTerminationNotificationSubscription
))
{
const
AppEnablementAPI__TypesAndValues
::
AppTerminationNotificationSubscription
&
app
=
msg
.
appTerminationNotificationSubscription
();
app
.
encode
(
AppEnablementAPI__TypesAndValues
::
AppTerminationNotificationSubscription_descr_
,
encoding_buffer
,
TTCN_EncDec
::
CT_JSON
);
data
=
char2oct
(
CHARSTRING
(
"{
\"
AppTerminationNotificationSubscription
\"
: "
))
+
OCTETSTRING
(
encoding_buffer
.
get_len
(),
encoding_buffer
.
get_data
())
+
char2oct
(
CHARSTRING
(
"}"
));
data
=
/*
char2oct(CHARSTRING("{\"AppTerminationNotificationSubscription\": ")) +
*/
OCTETSTRING
(
encoding_buffer
.
get_len
(),
encoding_buffer
.
get_data
())
/*
+ char2oct(CHARSTRING("}"))
*/
;
}
else
if
(
msg
.
ischosen
(
LibItsHttp__JsonMessageBodyTypes
::
JsonBody
::
ALT_dnsRule
))
{
const
AppEnablementAPI__TypesAndValues
::
DnsRule
&
dns_rule
=
msg
.
dnsRule
();
dns_rule
.
encode
(
AppEnablementAPI__TypesAndValues
::
DnsRule_descr_
,
encoding_buffer
,
TTCN_EncDec
::
CT_JSON
);
data
=
char2oct
(
CHARSTRING
(
"{
\"
DnsRule
\"
: "
))
+
OCTETSTRING
(
encoding_buffer
.
get_len
(),
encoding_buffer
.
get_data
())
+
char2oct
(
CHARSTRING
(
"}"
));
data
=
/*
char2oct(CHARSTRING("{\"DnsRule\": ")) +
*/
OCTETSTRING
(
encoding_buffer
.
get_len
(),
encoding_buffer
.
get_data
())
/*
+ char2oct(CHARSTRING("}"))
*/
;
}
else
if
(
msg
.
ischosen
(
LibItsHttp__JsonMessageBodyTypes
::
JsonBody
::
ALT_serAvailabilityNotificationSubscription
))
{
const
AppEnablementAPI__TypesAndValues
::
SerAvailabilityNotificationSubscription
&
ser
=
msg
.
serAvailabilityNotificationSubscription
();
ser
.
encode
(
AppEnablementAPI__TypesAndValues
::
SerAvailabilityNotificationSubscription_descr_
,
encoding_buffer
,
TTCN_EncDec
::
CT_JSON
);
data
=
char2oct
(
CHARSTRING
(
"{
\"
SerAvailabilityNotificationSubscription
\"
: "
))
+
OCTETSTRING
(
encoding_buffer
.
get_len
(),
encoding_buffer
.
get_data
())
+
char2oct
(
CHARSTRING
(
"}"
));
data
=
/*
char2oct(CHARSTRING("{\"SerAvailabilityNotificationSubscription\": ")) +
*/
OCTETSTRING
(
encoding_buffer
.
get_len
(),
encoding_buffer
.
get_data
())
/*
+ char2oct(CHARSTRING("}"))
*/
;
}
else
if
(
msg
.
ischosen
(
LibItsHttp__JsonMessageBodyTypes
::
JsonBody
::
ALT_trafficRule
))
{
const
AppEnablementAPI__TypesAndValues
::
TrafficRule
&
traffic_rule
=
msg
.
trafficRule
();
traffic_rule
.
encode
(
AppEnablementAPI__TypesAndValues
::
TrafficRule_descr_
,
encoding_buffer
,
TTCN_EncDec
::
CT_JSON
);
data
=
char2oct
(
CHARSTRING
(
"{
\"
SerAvailabilityNotificationSubscription
\"
: "
))
+
OCTETSTRING
(
encoding_buffer
.
get_len
(),
encoding_buffer
.
get_data
())
+
char2oct
(
CHARSTRING
(
"}"
));
data
=
/*
char2oct(CHARSTRING("{\"SerAvailabilityNotificationSubscription\": ")) +
*/
OCTETSTRING
(
encoding_buffer
.
get_len
(),
encoding_buffer
.
get_data
())
/*
+ char2oct(CHARSTRING("}"))
*/
;
}
else
{
loggers
::
get_instance
().
error
(
"json_codec::encode: Not supported"
);
}
...
...
@@ -75,6 +75,7 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
loggers
::
get_instance
().
warning
(
"json_codec::decode: Failed to access p_params item (decode_str)"
);
return
-
1
;
// TODO Use p_data instead of return -1
}
loggers
::
get_instance
().
log
(
"json_codec::decode: it->second='%c' / '%s'"
,
it
->
second
.
c_str
()[
0
],
it
->
second
.
c_str
());
}
// Remove data structure name (if present) ...
...
...
@@ -89,7 +90,7 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
// ..and create the decoding buffer
TTCN_EncDec
::
set_error_behavior
(
TTCN_EncDec
::
ET_ALL
,
TTCN_EncDec
::
EB_DEFAULT
);
TTCN_EncDec
::
clear_error
();
loggers
::
get_instance
().
log
(
"json_codec::decode: decoding_buffer=%c
/
%s"
,
str
[
0
],
str
.
c_str
());
loggers
::
get_instance
().
log
(
"json_codec::decode: decoding_buffer=
'
%c
' / '
%s
'
"
,
str
[
0
],
str
.
c_str
());
TTCN_Buffer
decoding_buffer
(
OCTETSTRING
(
str
.
length
(),
(
const
unsigned
char
*
)
str
.
c_str
()));
if
(
it
->
second
.
find
(
"
\"
userList
\"
"
)
!=
std
::
string
::
npos
)
{
// Be careful to the order
...
...
@@ -321,23 +322,15 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
TTCN_Buffer
decoding_buffer_
(
OCTETSTRING
(
str
.
length
(),
(
const
unsigned
char
*
)
str
.
c_str
()));
bw_info
.
decode
(
BwManagementAPI__TypesAndValues
::
BwInfo_descr_
,
decoding_buffer_
,
TTCN_EncDec
::
CT_JSON
);
msg
.
bwInfo
()
=
bw_info
;
}
else
if
(
it
->
second
.
find
(
"
\"
problemDetails
\"
"
)
!=
std
::
string
::
npos
)
{
// TODO To be refined, ProblemDetails in different modules
// UEidentityAPI__TypesAndValues::ProblemDetails problem_details;
// problem_details.decode(UEidentityAPI__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
// msg.problemDetails__ue__identity() = problem_details;
RnisAPI__TypesAndValues
::
ProblemDetails
problem_details
;
problem_details
.
decode
(
RnisAPI__TypesAndValues
::
ProblemDetails_descr_
,
decoding_buffer
,
TTCN_EncDec
::
CT_JSON
);
msg
.
problemDetails__rnis
()
=
problem_details
;
}
else
if
(
it
->
second
.
find
(
"
\"
detail
\"
"
)
!=
std
::
string
::
npos
)
{
LibMec__TypesAndValues
::
ProblemDetails
problem_details
;
problem_details
.
decode
(
LibMec__TypesAndValues
::
ProblemDetails_descr_
,
decoding_buffer
,
TTCN_EncDec
::
CT_JSON
);
msg
.
problemDetails
()
=
problem_details
;
}
else
{
loggers
::
get_instance
().
warning
(
"json_codec::decode: Unsupported variant"
);
return
-
1
;
}
loggers
::
get_instance
().
log_msg
(
"<<< json_codec::decode: "
,
(
const
Base_Type
&
)
msg
);
return
0
;
}
...
...
ttcn/AtsMec/AtsMec_Ams_TestCases.ttcn
View file @
b7a36f9f
...
...
@@ -28,6 +28,8 @@
import
from
Ams_Pixits
all
;
// LibMec
import
from
LibMec_TypesAndValues
all
;
import
from
LibMec_Templates
all
;
import
from
LibMec_Functions
all
;
import
from
LibMec_Pics
all
;
import
from
LibMec_Pixits
all
;
...
...
@@ -133,12 +135,12 @@
mw_http_response
(
mw_http_response_400_bad_request
(
mw_http_message_body_json
(
mw_body_json_
ams_
problem_details
(
mw_problem_details
(
-
,
-
,
400
))))))
{
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
400
))))))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with a ProblemDetails set to 400 Bad Request ***"
);
...
...
@@ -276,7 +278,7 @@
mw_http_response
(
mw_http_response_400_bad_request
(
mw_http_message_body_json
(
mw_body_json_
ams_
problem_details
(
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
400
)
...
...
@@ -925,7 +927,7 @@
mw_http_response
(
mw_http_response_400_bad_request
(
mw_http_message_body_json
(
mw_body_json_
ams_
problem_details
(
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
400
)
...
...
@@ -1073,7 +1075,7 @@
mw_http_response
(
mw_http_response_400_bad_request
(
mw_http_message_body_json
(
mw_body_json_
ams_
problem_details
(
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
400
)
...
...
@@ -1190,7 +1192,7 @@
mw_http_response
(
mw_http_response_404_not_found
(
mw_http_message_body_json
(
mw_body_json_
ams_
problem_details
(
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
404
)
...
...
@@ -1299,7 +1301,7 @@
mw_http_response
(
mw_http_response_404_not_found
(
mw_http_message_body_json
(
mw_body_json_
ams_
problem_details
(
mw_body_json_problem_details
(
)
)
)
...
...
@@ -1432,7 +1434,7 @@
mw_http_response
(
mw_http_response_400_bad_request
(
mw_http_message_body_json
(
mw_body_json_
ams_
problem_details
(
mw_body_json_problem_details
(
)
)
)
...
...
@@ -1494,7 +1496,7 @@
mw_http_response
(
mw_http_response_404_not_found
(
mw_http_message_body_json
(
mw_body_json_
ams_
problem_details
(
mw_body_json_problem_details
(
)
)
)
...
...
ttcn/AtsMec/AtsMec_AppEnablementAPI_TestCases.ttcn
View file @
b7a36f9f
...
...
@@ -28,6 +28,8 @@ module AtsMec_AppEnablementAPI_TestCases {
import
from
AppEnablementAPI_Pixits
all
;
// LibMec
import
from
LibMec_TypesAndValues
all
;
import
from
LibMec_Templates
all
;
import
from
LibMec_Functions
all
;
import
from
LibMec_Pics
all
;
import
from
LibMec_Pixits
all
;
...
...
@@ -179,7 +181,17 @@ module AtsMec_AppEnablementAPI_TestCases {
m_http_message_body_json
(
m_body_json_service_info
(
m_service_info
(
PX_SERVICE_NAME
PX_SERVICE_NAME
,
-
,
-
,
-
,
-
,
-
,
m_transport_info
(
"transportId1"
,
"TC_MEC_SRV_APPSAQ_002_OK"
,
REST_HTTP
,
"HTTP"
,
"2.0"
,
m_end_point_uris
({
"/meMp1/service/MyEntryPoint"
}),
m_security_info
)
)
)
)
...
...
@@ -194,11 +206,11 @@ module AtsMec_AppEnablementAPI_TestCases {
[]
httpPort
.
receive
(
mw_http_response
(
mw_http_response_201_created
(
mw_http_message_body_json
(
mw_body_json_service_info
(
mw_service_info
(
PX_SERVICE_NAME
//serName
))))))
->
value
v_response
{
mw_http_message_body_json
(
mw_body_json_service_info
(
mw_service_info
(
PX_SERVICE_NAME
//serName
))))))
->
value
v_response
{
tc_ac
.
stop
;
if
(
f_check_headers
(
valueof
(
v_response
.
response
.
header
))
==
true
)
{
...
...
@@ -218,7 +230,7 @@ module AtsMec_AppEnablementAPI_TestCases {
;
to the MEC_APP_Subscriber entity
*/
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with a ServiceInfo and set not
ofo
cation ***"
);
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with a ServiceInfo and set not
ifi
cation ***"
);
f_selfOrClientSyncAndVerdict
(
c_tbDone
,
e_success
);
}
else
{
log
(
"*** "
&
testcasename
()
&
": FAIL: Header 'Location' was not present in the response headers ***"
);
...
...
@@ -383,7 +395,7 @@ module AtsMec_AppEnablementAPI_TestCases {
httpPort
.
send
(
m_http_request
(
m_http_request_get
(
"/"
&
PICS_ROOT_API
&
PX_MEC_SVC_MGMT_APPS_URI
&
"/"
&
oct2char
(
unichar2oct
(
PX_APP_INSTANCE_ID
,
"UTF-8"
))
&
"/services/"
&
oct2char
(
unichar2oct
(
PX_SERVICE_ID
,
"UTF-8"
)),
"/"
&
PICS_ROOT_API
&
PX_MEC_SVC_MGMT_APPS_URI
&
"/"
&
oct2char
(
unichar2oct
(
PX_APP_INSTANCE_ID
,
"UTF-8"
))
&
"/services/"
&
oct2char
(
unichar2oct
(
PX_SERVICE_ID
,
"UTF-8"
)),
v_headers
)
)
...
...
@@ -2839,7 +2851,7 @@ module AtsMec_AppEnablementAPI_TestCases {
// Postamble
f_cf_01_http_down
();
}
// End of testcase TC_MEC_SRV_
APPSAQ
_00
4
_NF
}
// End of testcase TC_MEC_SRV_
TRAF
_00
3
_NF
/**
* @desc Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition
...
...
ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn
View file @
b7a36f9f
...
...
@@ -30,6 +30,8 @@ module AtsMec_RadioNodeLocationAPI_TestCases {
import
from
LocationAPI_Pixits
all
;
// LibMec
import
from
LibMec_TypesAndValues
all
;
import
from
LibMec_Templates
all
;
import
from
LibMec_Functions
all
;
import
from
LibMec_Pics
all
;
import
from
LibMec_Pixits
all
;
...
...
ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn
View file @
b7a36f9f
...
...
@@ -31,6 +31,8 @@ module AtsMec_RnisAPI_TestCases {
import
from
RnisAPI_Pixits
all
;
// LibMec
import
from
LibMec_TypesAndValues
all
;
import
from
LibMec_Templates
all
;
import
from
LibMec_Functions
all
;
import
from
LibMec_Pics
all
;
import
from
LibMec_Pixits
all
;
...
...
@@ -234,10 +236,10 @@ module AtsMec_RnisAPI_TestCases {
mw_http_response
(
mw_http_response_400_bad_request
(
mw_http_message_body_json
(
mw_body_json_
rni_
problem_details
(
mw_problem_details
(
-
,
-
,
400
))))))
{
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
400
))))))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with HTTP error 400 Bad Request ***"
);
...
...
@@ -308,10 +310,10 @@ module AtsMec_RnisAPI_TestCases {
mw_http_response
(
mw_http_response_400_bad_request
(
mw_http_message_body_json
(
mw_body_json_
rni_
problem_details
(
mw_problem_details
(
-
,
-
,
400
))))))
{
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
400
))))))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with a cell subscription ***"
);
...
...
@@ -596,10 +598,10 @@ module AtsMec_RnisAPI_TestCases {
mw_http_response
(
mw_http_response_400_bad_request
(
mw_http_message_body_json
(
mw_body_json_
rni_
problem_details
(
mw_problem_details
(
-
,
-
,
400
))))))
{
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
400
))))))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with HTTP error 400 Bad Request ***"
);
...
...
@@ -654,10 +656,10 @@ module AtsMec_RnisAPI_TestCases {
mw_http_response
(
mw_http_response_404_not_found
(
mw_http_message_body_json
(
mw_body_json_
rni_
problem_details
(
mw_problem_details
(
-
,
-
,
404
))))))
{
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
404
))))))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with HTTP error 400 Bad Request ***"
);
...
...
@@ -712,10 +714,10 @@ module AtsMec_RnisAPI_TestCases {
mw_http_response
(
mw_http_response_400_bad_request
(
mw_http_message_body_json
(
mw_body_json_
rni_
problem_details
(
mw_problem_details
(
-
,
-
,
400
))))))
{
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
400
))))))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with HTTP error 400 Bad Request ***"
);
...
...
@@ -770,10 +772,10 @@ module AtsMec_RnisAPI_TestCases {
mw_http_response
(
mw_http_response_404_not_found
(
mw_http_message_body_json
(
mw_body_json_
rni_
problem_details
(
mw_problem_details
(
-
,
-
,
404
))))))
{
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
404
))))))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with HTTP error 400 Bad Request ***"
);
...
...
@@ -828,10 +830,10 @@ module AtsMec_RnisAPI_TestCases {
mw_http_response
(
mw_http_response_400_bad_request
(
mw_http_message_body_json
(
mw_body_json_
rni_
problem_details
(
mw_problem_details
(
-
,
-
,
400
))))))
{
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
400
))))))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with HTTP error 400 Bad Request ***"
);
...
...
@@ -886,10 +888,10 @@ module AtsMec_RnisAPI_TestCases {
mw_http_response
(
mw_http_response_404_not_found
(
mw_http_message_body_json
(
mw_body_json_
rni_
problem_details
(
mw_problem_details
(
-
,
-
,
404
))))))
{
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
404
))))))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with HTTP error 400 Bad Request ***"
);
...
...
@@ -944,10 +946,10 @@ module AtsMec_RnisAPI_TestCases {
mw_http_response
(
mw_http_response_400_bad_request
(
mw_http_message_body_json
(
mw_body_json_
rni_
problem_details
(
mw_problem_details
(
-
,
-
,
400
))))))
{
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
400
))))))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with HTTP error 400 Bad Request ***"
);
...
...
@@ -1002,10 +1004,10 @@ module AtsMec_RnisAPI_TestCases {
mw_http_response
(
mw_http_response_404_not_found
(
mw_http_message_body_json
(
mw_body_json_
rni_
problem_details
(
mw_problem_details
(
-
,
-
,
404
))))))
{
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
404
))))))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with HTTP error 400 Bad Request ***"
);
...
...
ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn
View file @
b7a36f9f
...
...
@@ -27,6 +27,8 @@ module AtsMec_UEidentityAPI_TestCases {
import
from
UEidentityAPI_Pixits
all
;
// LibMec
import
from
LibMec_TypesAndValues
all
;
import
from
LibMec_Templates
all
;
import
from
LibMec_Functions
all
;
import
from
LibMec_Pics
all
;
import
from
LibMec_Pixits
all
;
...
...
@@ -130,10 +132,10 @@ module AtsMec_UEidentityAPI_TestCases {
mw_http_response
(
mw_http_response_400_bad_request
(
mw_http_message_body_json
(
mw_body_json_
ue_identity_
problem_details
(
mw_problem_details
(
-
,
-
,
400
))))))
{
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
400
))))))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with a ProblemDetails set to 400 Bad Request ***"
);
...
...
@@ -188,10 +190,10 @@ module AtsMec_UEidentityAPI_TestCases {
mw_http_response
(
mw_http_response_404_not_found
(
mw_http_message_body_json
(
mw_body_json_
ue_identity_
problem_details
(
mw_problem_details
(
-
,
-
,
404
))))))
{
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
404
))))))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with a ProblemDetails set to 404 Not Found ***"
);
...
...
@@ -343,10 +345,10 @@ module AtsMec_UEidentityAPI_TestCases {
mw_http_response
(
mw_http_response_400_bad_request
/*(
mw_http_message_body_json(
mw_body_json_
ue_identity_
problem_details(
mw_problem_details(
-, -, 400
))))*/
))
{
mw_body_json_problem_details(
mw_problem_details(
-, -, 400
))))*/
))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with a ProblemDetails set to 403 Forbidden ***"
);
...
...
@@ -413,10 +415,10 @@ module AtsMec_UEidentityAPI_TestCases {
mw_http_response
(
mw_http_response_412_precondition_failed
(
mw_http_message_body_json
(
mw_body_json_
ue_identity_
problem_details
(
mw_problem_details
(
-
,
-
,
412
))))))
{
mw_body_json_problem_details
(
mw_problem_details
(
-
,
-
,
412
))))))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with a ProblemDetails set to 412 Precondition Failed ***"
);
...
...
@@ -566,7 +568,7 @@ module AtsMec_UEidentityAPI_TestCases {
// mw_http_response(
// mw_http_response_400_bad_request(
// mw_http_message_body_json(
// mw_body_json_
ue_identity_
problem_details(
// mw_body_json_problem_details(
// mw_problem_details(
// -, -, 400
// )))))) {
...
...
ttcn/LibMec/Ams/ttcn/Ams_Templates.ttcn
View file @
b7a36f9f
...
...
@@ -263,34 +263,5 @@ module Ams_Templates {
template
(
value
)
ProblemDetails
m_problem_details
(
in
JSON
.
String
p_type
,
in
JSON
.
String
p_title
,
in
UInt32
p_status
,
in
JSON
.
String
p_detail
,
in
JSON
.
String
p_instance
)
:=
{
type_
:=
p_type
,
title
:=
p_title
,
status
:=
p_status
,
detail
:=
p_detail
,
instance
:=
p_instance
}
// End of template m_problem_details
template
(
present
)
ProblemDetails
mw_problem_details
(
template
(
present
)
JSON
.
String
p_type
:=
?
,
template
(
present
)
JSON
.
String
p_title
:=
?
,
template
(
present
)
UInt32
p_status
:=
?
,
template
(
present
)
JSON
.
String
p_detail
:=
?
,
template
(
present
)
JSON
.
String
p_instance
:=
?
)
:=
{
type_
:=
p_type
,
title
:=
p_title
,
status
:=
p_status
,
detail
:=
p_detail
,
instance
:=
p_instance
}
// End of template mw_problem_details
}
// End of module LocationAPI_Templates
ttcn/LibMec/Ams/ttcn/Ams_TypesAndValues.ttcn
View file @
b7a36f9f
...
...
@@ -162,25 +162,6 @@ type record AdjacentAppInfoSubscription {
*/
type
UInt32
NanoSeconds
;
/**
* @desc Problem Details for HTTP APIs
* @member type_ A URI reference according to IETF RFC 3986 that identifies the problem type
* @member title A short, human-readable summary of the problem type
* @member status The HTTP status code for this occurrence of the problem
* @member detail A human-readable explanation specific to this occurrence of the problem
* @member instance A URI reference that identifies the specific occurrence of the problem
* @see IETF RFC 7807 Clause 3. The Problem Details JSON Object
*/
type
record
ProblemDetails
{
JSON
.
String
type_
,
JSON
.
String
title
,
UInt32
status
,
JSON
.
String
detail
,
JSON
.
String
instance
}
with
{
variant
(
type_
)
"name as 'type'"
;
}
//
//
//
...
...
ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_Templates.ttcn
View file @
b7a36f9f
...
...
@@ -14,19 +14,37 @@ module AppEnablementAPI_Templates {
import
from
AppEnablementAPI_TypesAndValues
all
;
import
from
AppEnablementAPI_Pixits
all
;
template
(
present
)
ProblemDetails
mw_problem_details
(
template
(
present
)
JSON
.
String
p_type
:=
?
,
template
(
present
)
JSON
.
String
p_title
:=
?
,
template
(
present
)
UInt32
p_status
:=
?
,
template
(
present
)
JSON
.
String
p_detail
:=
?
,
template
(
present
)
JSON
.
String
p_instance
:=
?
)
:=
{
type_
:=
p_type
,
title
:=
p_title
,
status
:=
p_status
,
detail
:=
p_detail
,
instance
:=
p_instance
}
// End of template mw_problem_details
template
(
value
)
SecurityInfo
m_security_info
(
in
GrantTypesList
p_grantTypes
:=
{
OAUTH2_CLIENT_CREDENTIALS
},
in
TokenEndpoint
p_tokenEndpoint
:=
"/mecSerMgmtApi/security/MyTokenEndPoint"
)
:=
{
oAuth2Info
:=
{
grantTypes
:=
p_grantTypes
,
tokenEndpoint
:=
p_tokenEndpoint
}
}
// End of template m_security_info
template
(
present
)
SecurityInfo
mw_security_info
(
template
(
present
)
GrantTypesList
p_grantTypes
:=
?
,
template
(
present
)
TokenEndpoint
p_tokenEndpoint
:=
?
)
:=
{
oAuth2Info
:=
{
grantTypes
:=
p_grantTypes
,
tokenEndpoint
:=
p_tokenEndpoint
}
}
// End of template mw_security_info
template
(
value
)
TransportInfo_Endpoint
m_end_point_uris
(
in
template
(
value
)
EndPointInfo_UriList
p_uris
)
:=
{
uris
:=
p_uris
}
// End of template m_end_point_uris
template
(
present
)
TransportInfo_Endpoint
mw_end_point_uris
(
template
(
present
)
EndPointInfo_UriList
p_uris
:=
?
)
:=
{
uris
:=
p_uris
}
// End of template mw_end_point_uris