-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3994 from Anjali-NEC/issue1492
Fix using limit=0 and details=on to get only the count of elements #1492
- Loading branch information
Showing
12 changed files
with
707 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
- Fix: allow limit=0 in all paginated operations in the NGSIv2 API (entities, entity types, subscriptions and registrations) (#1492) | ||
- Add: conditions.alterationTypes subscription fuctionality (#1494) | ||
- Reference distribution changed RHEL/CentOS 8 to Debian 11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
142 changes: 142 additions & 0 deletions
142
test/functionalTest/cases/1492_limit_zero/limit_zero_entities.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
# Copyright 2021 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_entities | ||
|
||
--SHELL-INIT-- | ||
dbInit CB | ||
brokerStart CB | ||
|
||
--SHELL-- | ||
|
||
# | ||
# 01. GET /v2/entities with 'limit' == 0 and options=count and see no entities and fiware-total-count: 0 | ||
# 02. POST /v2/entities to create E1 entity | ||
# 03. POST /v2/entities to create E2 entity | ||
# 04. GET /v2/entities with 'limit' == 0 and options=count and see no entities and fiware-total-count: 2 | ||
# 05. GET /v2/entities with 'limit' == 0 and see no entities | ||
# | ||
|
||
echo "01. GET /v2/entities with 'limit' == 0 and options=count and see no entities and fiware-total-count: 0" | ||
echo "======================================================================================================" | ||
orionCurl --url "/v2/entities?limit=0&options=count" | ||
echo | ||
echo | ||
|
||
|
||
echo "02. POST /v2/entities to create E1 entity" | ||
echo "=========================================" | ||
payload='{ | ||
"id": "E1", | ||
"type": "T" | ||
}' | ||
orionCurl --url /v2/entities -X POST --payload "$payload" | ||
echo | ||
echo | ||
|
||
|
||
echo "03. POST /v2/entities to create E2 entity" | ||
echo "=========================================" | ||
payload='{ | ||
"id": "E2", | ||
"type": "T" | ||
}' | ||
orionCurl --url /v2/entities -X POST --payload "$payload" | ||
echo | ||
echo | ||
|
||
|
||
echo "04. GET /v2/entities with 'limit' == 0 and options=count and see no entities and fiware-total-count: 2" | ||
echo "======================================================================================================" | ||
orionCurl --url "/v2/entities?limit=0&options=count" | ||
echo | ||
echo | ||
|
||
|
||
echo "05. GET /v2/entities with 'limit' == 0 and see no entities" | ||
echo "==========================================================" | ||
orionCurl --url "/v2/entities?limit=0" | ||
echo | ||
echo | ||
|
||
|
||
|
||
--REGEXPECT-- | ||
01. GET /v2/entities with 'limit' == 0 and options=count and see no entities and fiware-total-count: 0 | ||
====================================================================================================== | ||
HTTP/1.1 200 OK | ||
Content-Length: 2 | ||
Content-Type: application/json | ||
Fiware-Total-Count: 0 | ||
Fiware-Correlator: REGEX([0-9a-f\-]{36}) | ||
Date: REGEX(.*) | ||
|
||
[] | ||
|
||
|
||
02. POST /v2/entities to create E1 entity | ||
========================================= | ||
HTTP/1.1 201 Created | ||
Content-Length: 0 | ||
Location: /v2/entities/E1?type=T | ||
Fiware-Correlator: REGEX([0-9a-f\-]{36}) | ||
Date: REGEX(.*) | ||
|
||
|
||
|
||
03. POST /v2/entities to create E2 entity | ||
========================================= | ||
HTTP/1.1 201 Created | ||
Content-Length: 0 | ||
Location: /v2/entities/E2?type=T | ||
Fiware-Correlator: REGEX([0-9a-f\-]{36}) | ||
Date: REGEX(.*) | ||
|
||
|
||
|
||
04. GET /v2/entities with 'limit' == 0 and options=count and see no entities and fiware-total-count: 2 | ||
====================================================================================================== | ||
HTTP/1.1 200 OK | ||
Content-Length: 2 | ||
Content-Type: application/json | ||
Fiware-Total-Count: 2 | ||
Fiware-Correlator: REGEX([0-9a-f\-]{36}) | ||
Date: REGEX(.*) | ||
|
||
[] | ||
|
||
|
||
05. GET /v2/entities with 'limit' == 0 and see no entities | ||
========================================================== | ||
HTTP/1.1 200 OK | ||
Content-Length: 2 | ||
Content-Type: application/json | ||
Fiware-Correlator: REGEX([0-9a-f\-]{36}) | ||
Date: REGEX(.*) | ||
|
||
[] | ||
|
||
|
||
--TEARDOWN-- | ||
brokerStop CB | ||
dbDrop CB |
Oops, something went wrong.