Skip to content

Commit

Permalink
FIX check spectations
Browse files Browse the repository at this point in the history
  • Loading branch information
fgalan committed Apr 27, 2022
1 parent 52efc9f commit ae956ec
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,19 @@ orionCurl --url "$url" --payload "$payload"
echo
echo


# After fixing issue #1492 this has become a not-bad request case, but we keep
# in this file for simplicity (NGSIv1 is a deprecated API)
echo "+++++ 3. URI param 'limit' == 0"
url="/v1/queryContext?limit=000000"
payload='NO PAYLOAD NECESSARY'
payload='{
"entities": [
{
"type": "",
"isPattern": "false",
"id": "EVector"
}
]
}'
orionCurl --url "$url" --payload "$payload"
echo
echo
Expand Down Expand Up @@ -94,16 +103,15 @@ Date: REGEX(.*)

+++++ 3. URI param 'limit' == 0
HTTP/1.1 200 OK
Content-Length: 86
Content-Length: 70
Content-Type: application/json
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Date: REGEX(.*)

{
"errorCode": {
"code": "400",
"details": "JSON Parse Error",
"reasonPhrase": "Bad Request"
"code": "404",
"reasonPhrase": "No context element found"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,96 +30,84 @@ brokerStart CB
--SHELL--

#
# 01. GET /v2/entities with limit = 0 and see error
# 02. GET /v2/types with limit = 0 and see error
# 03. GET /v2/subscriptions with limit = 0 and see error
# 04. GET /v2/registrations with limit = 0 and see error
# 01. GET /v2/entities with limit = 0
# 02. GET /v2/types with limit = 0
# 03. GET /v2/subscriptions with limit = 0
# 04. GET /v2/registrations with limit = 0
#
#

echo "01. GET /v2/entities with limit = 0 and see error"
echo "================================================="
echo "01. GET /v2/entities with limit = 0"
echo "==================================="
orionCurl --url "/v2/entities?limit=0"
echo
echo


echo "02. GET /v2/types with limit = 0 and see error"
echo "=============================================="
echo "02. GET /v2/types with limit = 0"
echo "================================"
orionCurl --url "/v2/types?limit=0"
echo
echo


echo "03. GET /v2/subscriptions with limit = 0 and see error"
echo "======================================================"
echo "03. GET /v2/subscriptions with limit = 0"
echo "========================================"
orionCurl --url "/v2/subscriptions?limit=0"
echo
echo


echo "04. GET /v2/registrations with limit = 0 and see error"
echo "======================================================"
echo "04. GET /v2/registrations with limit = 0"
echo "========================================"
orionCurl --url "/v2/registrations?limit=0"
echo
echo


--REGEXPECT--
01. GET /v2/entities with limit = 0 and see error
=================================================
HTTP/1.1 400 Bad Request
Content-Length: 98
01. GET /v2/entities with limit = 0
===================================
HTTP/1.1 200 OK
Content-Length: 2
Content-Type: application/json
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Date: REGEX(.*)

{
"description": "Bad pagination limit: /0/ [a value of ZERO is unacceptable]",
"error": "BadRequest"
}
[]


02. GET /v2/types with limit = 0 and see error
==============================================
HTTP/1.1 400 Bad Request
Content-Length: 98
02. GET /v2/types with limit = 0
================================
HTTP/1.1 200 OK
Content-Length: 2
Content-Type: application/json
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Date: REGEX(.*)

{
"description": "Bad pagination limit: /0/ [a value of ZERO is unacceptable]",
"error": "BadRequest"
}
[]


03. GET /v2/subscriptions with limit = 0 and see error
======================================================
HTTP/1.1 400 Bad Request
Content-Length: 98
03. GET /v2/subscriptions with limit = 0
========================================
HTTP/1.1 200 OK
Content-Length: 2
Content-Type: application/json
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Date: REGEX(.*)

{
"description": "Bad pagination limit: /0/ [a value of ZERO is unacceptable]",
"error": "BadRequest"
}
[]


04. GET /v2/registrations with limit = 0 and see error
======================================================
HTTP/1.1 400 Bad Request
Content-Length: 98
04. GET /v2/registrations with limit = 0
========================================
HTTP/1.1 200 OK
Content-Length: 2
Content-Type: application/json
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Date: REGEX(.*)

{
"description": "Bad pagination limit: /0/ [a value of ZERO is unacceptable]",
"error": "BadRequest"
}
[]


--TEARDOWN--
Expand Down

0 comments on commit ae956ec

Please sign in to comment.