Skip to content

Commit

Permalink
FIX ftest
Browse files Browse the repository at this point in the history
  • Loading branch information
fgalan committed Nov 20, 2023
1 parent a772397 commit f4eb0a2
Show file tree
Hide file tree
Showing 20 changed files with 390 additions and 48 deletions.
4 changes: 2 additions & 2 deletions src/lib/mongoBackend/MongoCommonUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3623,7 +3623,7 @@ static unsigned int updateEntity
{
for (unsigned int ix = 0; ix < eP->attributeVector.size(); ++ix)
{
if (attrs.hasField(eP->attributeVector[ix]->name))
if (attrs.hasField(dbEncode(eP->attributeVector[ix]->name)))
{
alarmMgr.badInput(clientIp, "attribute already exists", eP->attributeVector[ix]->name);
*attributeAlreadyExistsError = true;
Expand All @@ -3649,7 +3649,7 @@ static unsigned int updateEntity
{
for (unsigned int ix = 0; ix < eP->attributeVector.size(); ++ix)
{
if (!attrs.hasField (eP->attributeVector[ix]->name))
if (!attrs.hasField(dbEncode(eP->attributeVector[ix]->name)))
{
*attributeNotExistingError = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Content-Type: application/json
Content-Length: 110
Content-Length: 115

{
"description": "one or more of the attributes in the request do not exist: [ attr3 ]",
"description": "one or more of the attributes in the request do not exist: E1 - [ attr3 ]",
"error": "Unprocessable"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Content-Type: application/json
Content-Length: 107
Content-Length: 112

{
"description": "one or more of the attributes in the request do not exist: [ A2 ]",
"description": "one or more of the attributes in the request do not exist: E1 - [ A2 ]",
"error": "Unprocessable"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,10 @@ HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Content-Type: application/json
Content-Length: 111
Content-Length: 116

{
"description": "one or more of the attributes in the request already exist: [ attr4 ]",
"description": "one or more of the attributes in the request already exist: E1 - [ attr4 ]",
"error": "Unprocessable"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Content-Type: application/json
Content-Length: 111
Content-Length: 116

{
"description": "one or more of the attributes in the request already exist: [ attr1 ]",
"description": "one or more of the attributes in the request already exist: E1 - [ attr1 ]",
"error": "Unprocessable"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Content-Type: application/json
Content-Length: 111
Content-Length: 116

{
"description": "one or more of the attributes in the request already exist: [ attr1 ]",
"description": "one or more of the attributes in the request already exist: E1 - [ attr1 ]",
"error": "Unprocessable"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Content-Type: application/json
Content-Length: 108
Content-Length: 113

{
"description": "one or more of the attributes in the request already exist: [ A3 ]",
"description": "one or more of the attributes in the request already exist: E1 - [ A3 ]",
"error": "Unprocessable"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ Content-Length: 121

03. DELETE /v2/entities/E1/attrs/none
=====================================
HTTP/1.1 404 Not Found
HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Content-Type: application/json
Content-Length: 79
Content-Length: 114

{
"description": "The entity does not have such an attribute",
"error": "NotFound"
"description": "one or more of the attributes in the request do not exist: E1 - [ none ]",
"error": "Unprocessable"
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ HTTP/1.1 200 OK
Date: REGEX(.*)
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Content-Type: application/json
Content-Length: 224
Content-Length: 229

{
"contextResponses": [
Expand All @@ -251,7 +251,7 @@ Content-Length: 224
},
"statusCode": {
"code": "400",
"details": "one or more of the attributes in the request already exist: [ attr2 ]",
"details": "one or more of the attributes in the request already exist: E1 - [ attr2 ]",
"reasonPhrase": "Bad Request"
}
}
Expand Down Expand Up @@ -289,7 +289,7 @@ HTTP/1.1 200 OK
Date: REGEX(.*)
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Content-Type: application/json
Content-Length: 388
Content-Length: 393

{
"contextResponses": [
Expand Down Expand Up @@ -319,7 +319,7 @@ Content-Length: 388
},
"statusCode": {
"code": "400",
"details": "one or more of the attributes in the request already exist: [ attr2 ]",
"details": "one or more of the attributes in the request already exist: E1 - [ attr2 ]",
"reasonPhrase": "Bad Request"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Content-Type: application/json
Content-Length: 107
Content-Length: 112

{
"description": "one or more of the attributes in the request do not exist: [ A2 ]",
"description": "one or more of the attributes in the request do not exist: E1 - [ A2 ]",
"error": "Unprocessable"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Content-Type: application/json
Content-Length: 113
Content-Length: 122

{
"description": "one or more of the attributes in the request do not exist: [ dfgdfgdf ]",
"description": "one or more of the attributes in the request do not exist: room_2 - [ dfgdfgdf ]",
"error": "Unprocessable"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Content-Type: application/json
Content-Length: 107
Content-Length: 112

{
"description": "one or more of the attributes in the request already exist: [ A ]",
"description": "one or more of the attributes in the request already exist: E1 - [ A ]",
"error": "Unprocessable"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Content-Type: application/json
Content-Length: 108
Content-Length: 113

{
"description": "one or more of the attributes in the request already exist: [ A1 ]",
"description": "one or more of the attributes in the request already exist: E1 - [ A1 ]",
"error": "Unprocessable"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,15 @@ Content-Length: 454

03. Delete E1-A1/A2=null, E2-A1/A2=null (A2 not existing) and E3-A1/A2=null using POST /v2/op/update with delete, get error
===========================================================================================================================
HTTP/1.1 404 Not Found
HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Content-Type: application/json
Content-Length: 79
Content-Length: 112

{
"description": "The entity does not have such an attribute",
"error": "NotFound"
"description": "one or more of the attributes in the request do not exist: E2 - [ A2 ]",
"error": "Unprocessable"
}


Expand Down
Loading

0 comments on commit f4eb0a2

Please sign in to comment.