Commit 4b4b909e authored by kzangeli's avatar kzangeli
Browse files

fix: 021_25 — own expectation with both temporal entities

021_25 queries the temporal evolution with no entity-id filter
(local=true, timerel=after 2020-07-01), so both entities its setup
creates (021-06-A and 021-06-B) match. The test reused 021_06's
expectation file, which only contains A because 021_06 queries with
id=…021-06-A — a conforming broker returning B failed the comparison.

New expectation vehicles-temporal-representation-021-25.jsonld carries
A (as in the 021-06 file) plus B (the 2020-09 payload's instances);
021_25.robot now references it.

Analysis recorded as testsuite-doubts.md #92.
parent d9a20233
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ Suite Teardown Delete Initial Temporal Entities
*** Variables ***
${first_vehicle_payload_file}=      2020-08-vehicle-temporal-representation.jsonld
${second_vehicle_payload_file}=     2020-09-vehicle-temporal-representation.jsonld
${expectation_file}=                vehicles-temporal-representation-021-06.jsonld
${expectation_file}=                vehicles-temporal-representation-021-25.jsonld


*** Test Cases ***
+78 −0
Original line number Diff line number Diff line
[
  {
    "id": "urn:ngsi-ld:Vehicle:021-06-A",
    "type": "Vehicle",
    "fuelLevel": [
      {
        "type": "Property",
        "value": 40,
        "observedAt": "2020-08-01T14:07:00Z"
      },
      {
        "type": "Property",
        "value": 67,
        "observedAt": "2020-08-01T12:03:00Z"
      },
      {
        "type": "Property",
        "value": 53,
        "observedAt": "2020-08-01T13:05:00Z"
      }
    ],
    "speed": [
      {
        "type": "Property",
        "value": 100,
        "observedAt": "2020-08-01T12:07:00Z"
      },
      {
        "type": "Property",
        "value": 80,
        "observedAt": "2020-08-01T12:05:00Z"
      },
      {
        "type": "Property",
        "value": 120,
        "observedAt": "2020-08-01T12:03:00Z"
      }
    ]
  },
  {
    "id": "urn:ngsi-ld:Vehicle:021-06-B",
    "type": "Vehicle",
    "speed": [
      {
        "type": "Property",
        "value": 120,
        "observedAt": "2020-09-01T12:03:00Z"
      },
      {
        "type": "Property",
        "value": 80,
        "observedAt": "2020-09-01T12:05:00Z"
      },
      {
        "type": "Property",
        "value": 100,
        "observedAt": "2020-09-01T12:07:00Z"
      }
    ],
    "fuelLevel": [
      {
        "type": "Property",
        "value": 67,
        "observedAt": "2020-09-01T12:03:00Z"
      },
      {
        "type": "Property",
        "value": 53,
        "observedAt": "2020-09-01T13:05:00Z"
      },
      {
        "type": "Property",
        "value": 40,
        "observedAt": "2020-09-01T14:07:00Z"
      }
    ]
  }
]
 No newline at end of file
+20 −0
Original line number Diff line number Diff line
@@ -2667,3 +2667,23 @@ doesn't match the URL id.
`$.id` with the actual `${entity_id}` before PATCHing. Or omit the
`id` from the fragment entirely (PATCH attrs doesn't need it).



## 92. `021_25` — reuses 021_06's expectation although it queries without an id filter

**Hit:** `021_25` (Query All Temporal Entities With Local Flag) fails with
`Item root['urn:ngsi-ld:Vehicle:021-06-B'] added to dictionary`.

**Analysis:** the suite's setup creates TWO temporal entities (021-06-A from
the 2020-08 payload, 021-06-B from the 2020-09 payload) — the same setup as
`021_06`. But where 021_06 queries with `id=…021-06-A` (so only A comes
back), 021_25 queries with **no** entity-id filter at all (`timerel=after`,
`timeAt=2020-07-01T12:05:00Z`, `local=true`). Both entities' instances lie
after the timeAt, so a conforming broker returns A **and** B. The test
nevertheless reuses 021_06's expectation file
(`vehicles-temporal-representation-021-06.jsonld`), which contains only A —
any broker that correctly returns B fails the comparison.

**Fix:** dedicated expectation `vehicles-temporal-representation-021-25.jsonld`
containing both entities (A's instances as in the 021-06 file + B's instances
straight from the 2020-09 payload), and 021_25.robot pointed at it.