Skip to content

Commit

Permalink
Merge branch 'master' into issue1492-prelanding
Browse files Browse the repository at this point in the history
  • Loading branch information
fgalan committed Apr 27, 2022
2 parents 3d95610 + 338906d commit 52efc9f
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ mkdocs:
configuration: mkdocs.yml

python:
version: 3.6
version: 3.8
install:
- requirements: doc/requirements.txt
4 changes: 4 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mkdocs==1.2.3
Pygments==2.9.0
Markdown==3.3.4
jinja2==3.0.0
127 changes: 127 additions & 0 deletions test/functionalTest/cases/1492_limit_zero/limit_zero_simple_cases.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Copyright 2022 Telefonica Investigacion y Desarrollo, S.A.U
#
# This file is part of Orion Context Broker.
#
# Orion Context Broker is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Orion Context Broker is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
# General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/.
#
# For those usages not covered by this license please contact with
# iot_support at tid dot es

# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh

--NAME--
Limit zero simple cases

--SHELL-INIT--
dbInit CB
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
#
#

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


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


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


echo "04. GET /v2/registrations with limit = 0 and see error"
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
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
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
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
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--
brokerStop CB
dbDrop CB

0 comments on commit 52efc9f

Please sign in to comment.