Skip to content

Commit

Permalink
Merge pull request #1819 from telefonicaid/hardening/bug_1782_tests_r…
Browse files Browse the repository at this point in the history
…eview

[FIX] bug 1782 and tests reviewed
  • Loading branch information
crbrox committed Feb 22, 2016
2 parents 44234f3 + fd2d4fa commit 133cd24
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Feature: replace attributes by entity ID using NGSI v2. "PUT" - /v2/entities/<en
| error | NotFound |
| description | No context element found |

@entity_id_replace_invalid @BUG_1782 @skip
@entity_id_replace_invalid
Scenario Outline: try to replace attributes by entity ID using NGSI v2 with invalid entity id values
Given a definition of headers
| parameter | value |
Expand Down Expand Up @@ -169,12 +169,33 @@ Feature: replace attributes by entity ID using NGSI v2. "PUT" - /v2/entities/<en
| house(flat) |
| {\'a\':34} |
| [\'34\', \'a\', 45] |
| house_? |
| house_& |
| house_/ |
| house_# |
| my house |

@entity_id_replace_invalid @BUG_1782
Scenario Outline: try to replace attributes by entity ID using NGSI v2 with invalid entity id values
Given a definition of headers
| parameter | value |
| Fiware-Service | test_replace_entity_id |
| Fiware-ServicePath | /test |
| Content-Type | application/json |
# These properties below are used in update request
And properties to entities
| parameter | value |
| attributes_name | pressure |
| attributes_value | 80 |
When replace attributes by ID "<entity_id>" if it exists and with "normalized" mode
Then verify that receive an "Not Found" http code
And verify an error response
| parameter | value |
| error | NotFound |
| description | No context element found |
Examples:
| entity_id |
| house_? |
| house_/ |
| house_# |

# --------------------- attribute name ------------------------------------

@attribute_name_replace @BUG_1323
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ Feature: update attributes by entity ID if it exists using NGSI v2. "PATCH" - /v
| description | No context element found |

@entity_id_update_invalid.row<row.id>
@entity_id_update_invalid @BUG_1280 @BUG_1782 @skip
@entity_id_update_invalid @BUG_1280
Scenario Outline: try to update attributes by entity ID using NGSI v2 with invalid entity id values
Given a definition of headers
| parameter | value |
Expand Down Expand Up @@ -660,12 +660,34 @@ Feature: update attributes by entity ID if it exists using NGSI v2. "PATCH" - /v
| house(flat) |
| {\'a\':34} |
| [\'34\', \'a\', 45] |
| house_? |
| house_& |
| house_/ |
| house_# |
| my house |

@entity_id_update_invalid @BUG_1280 @BUG_1782
Scenario Outline: try to update attributes by entity ID using NGSI v2 with invalid entity id values
Given a definition of headers
| parameter | value |
| Fiware-Service | test_update_entity_id |
| Fiware-ServicePath | /test |
| Content-Type | application/json |
# These properties below are used in update request
And properties to entities
| parameter | value |
| attributes_number | 2 |
| attributes_name | temperature |
| attributes_value | 80 |
When update attributes by ID "<entity_id>" if it exists and with "normalized" mode
Then verify that receive an "Not Found" http code
And verify an error response
| parameter | value |
| error | NotFound |
| description | No context element found |
Examples:
| entity_id |
| house_? |
| house_/ |
| house_# |

@entity_id_update_empty @BUG_1783 @skip
Scenario: try to update attributes by entity ID using NGSI v2 with empty entity id values
Given a definition of headers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ Feature: update or append an attribute by entity ID using NGSI v2. "POST" - /v2/
| random=100 |
| random=256 |

@entity_id_unknown @BUG_1206
@entity_id_unknown @BUG_1206 @BUG_1817 @skip
Scenario: try to append entity and attributes by entity ID using NGSI v2 with unknown entity
Given a definition of headers
| parameter | value |
Expand All @@ -782,7 +782,7 @@ Feature: update or append an attribute by entity ID using NGSI v2. "POST" - /v2/
| error | InvalidModification |
| description | Entity does not exist |

@entity_id_update_invalid @BUG_1782 @skip
@entity_id_update_invalid
Scenario Outline: try to update or append attributes by entity ID using NGSI v2 with invalid entity id values
Given a definition of headers
| parameter | value |
Expand Down Expand Up @@ -810,12 +810,33 @@ Feature: update or append an attribute by entity ID using NGSI v2. "POST" - /v2/
| house(flat) |
| {\'a\':34} |
| [\'34\', \'a\', 45] |
| house_? |
| house_& |
| house_/ |
| house_# |
| my house |

@entity_id_update_invalid @BUG_1782 @BUG_1817 @skip
Scenario Outline: try to update or append attributes by entity ID using NGSI v2 with invalid entity id values
Given a definition of headers
| parameter | value |
| Fiware-Service | test_update_entity_id |
| Fiware-ServicePath | /test |
| Content-Type | application/json |
# These properties below are used in update request
And properties to entities
| parameter | value |
| attributes_name | humidity |
| attributes_value | 80 |
When update or append attributes by ID "<entity_id>" and with "normalized" mode
Then verify that receive an "Not Found" http code
And verify an error response
| parameter | value |
| error | NotFound |
| description | No context element found |
Examples:
| entity_id |
| house_? |
| house_/ |
| house_# |

# ----------------------- attributes ---------------------------------------

@attribute_multiples
Expand Down

0 comments on commit 133cd24

Please sign in to comment.