@@ -4,31 +4,34 @@ Feature: Asset Controller
44 # Create
55 When I successfully execute the action "device-manager/assets" :"create" with args:
66 | engineId | "engine -kuzzle " |
7- | body .model | "container " |
7+ | body .model | "Container " |
88 | body .reference | "A1 " |
99 | body .metadata .height | 5 |
10- Then The document "engine-kuzzle" :"assets" :"container-A1" content match:
11- | metadata .height | 5 |
12- | metadata .weight | null |
13- | linkedDevices | [] |
10+ Then The document "engine-kuzzle" :"assets" :"Container-A1" content match:
11+ | metadata .height | 5 |
12+ | metadata .weight | null |
13+ | measures .temperatureExt .type | "temperature " |
14+ | measures .temperatureInt .type | "temperature " |
15+ | measures .position .type | "position " |
16+ | linkedDevices | [] |
1417 When I successfully execute the action "device-manager/assets" :"update" with args:
1518 | engineId | "engine -kuzzle " |
16- | _id | "container -A1 " |
19+ | _id | "Container -A1 " |
1720 | body .metadata .weight | 1250 |
18- Then The document "engine-kuzzle" :"assets" :"container -A1" content match:
21+ Then The document "engine-kuzzle" :"assets" :"Container -A1" content match:
1922 | metadata .height | 5 |
2023 | metadata .weight | 1250 |
2124 # Get
2225 When I successfully execute the action "device-manager/assets" :"get" with args:
2326 | engineId | "engine -kuzzle " |
24- | _id | "container -A1 " |
27+ | _id | "Container -A1 " |
2528 Then I should receive a result matching:
2629 | _source .metadata .height | 5 |
2730 | _source .reference | "A1 " |
2831 # Search
2932 Given I successfully execute the action "device-manager/assets" :"create" with args:
3033 | engineId | "engine -kuzzle " |
31- | body .model | "container " |
34+ | body .model | "Container " |
3235 | body .reference | "B2 " |
3336 And I refresh the collection "engine-kuzzle" :"assets"
3437 When I successfully execute the action "device-manager/assets" :"search" with args:
@@ -38,12 +41,12 @@ Feature: Asset Controller
3841 | lang | "koncorde " |
3942 Then I should receive a "hits" array of objects matching:
4043 | _id |
41- | "container -A1 " |
44+ | "Container -A1 " |
4245 # Delete
4346 When I successfully execute the action "device-manager/assets" :"delete" with args:
4447 | engineId | "engine -kuzzle " |
45- | _id | "container -A1 " |
46- Then The document "engine-kuzzle" :"assets" :"container -A1" does not exists
48+ | _id | "Container -A1 " |
49+ Then The document "engine-kuzzle" :"assets" :"Container -A1" does not exists
4750
4851 Scenario : Error when creating Asset from unknown model
4952 When I execute the action "device-manager/assets" :"create" with args:
@@ -56,8 +59,8 @@ Feature: Asset Controller
5659 Scenario : Update linked device when deleting asset
5760 When I successfully execute the action "device-manager/assets" :"delete" with args:
5861 | engineId | "engine -ayse " |
59- | _id | "container -linked1 " |
60- Then The document "engine-ayse" :"assets" :"container -linked1" does not exist:
62+ | _id | "Container -linked1 " |
63+ Then The document "engine-ayse" :"assets" :"Container -linked1" does not exist:
6164 And The document "device-manager" :"devices" :"DummyTemp-linked1" content match:
6265 | assetId | null |
6366 And The document "engine-ayse" :"devices" :"DummyTemp-linked1" content match:
@@ -72,55 +75,55 @@ Feature: Asset Controller
7275 And I refresh the collection "engine-ayse" :"measures"
7376 When I successfully execute the action "device-manager/assets" :"getMeasures" with args:
7477 | engineId | "engine -ayse " |
75- | _id | "container -linked1 " |
78+ | _id | "Container -linked1 " |
7679 | size | 2 |
7780 Then I should receive a "measures" array of objects matching:
78- | _source .values .temperature | _source .asset ._id | _source .origin ._id | _source .asset .model |
79- | 40 | "container -linked1 " | "DummyTemp -linked1 " | "container " |
80- | 41 | "container -linked1 " | "DummyTemp -linked1 " | "container " |
81+ | _source .values .temperature | _source .asset ._id | _source .origin ._id | _source .asset .model |
82+ | 40 | "Container -linked1 " | "DummyTemp -linked1 " | "Container " |
83+ | 41 | "Container -linked1 " | "DummyTemp -linked1 " | "Container " |
8184
8285 Scenario : Push a measures in the asset, an other with different name and an older one
8386 When I successfully execute the action "device-manager/measures" :"push" with args:
8487 | engineId | "engine -ayse " |
85- | body .assetId | "container -unlinked1 " |
88+ | body .assetId | "Container -unlinked1 " |
8689 | body .measure .type | "temperature " |
8790 | body .measure .values .temperature | 26 |
8891 | body .measure .type | "temperature " |
8992 | body .measure .name | "temperatureExt " |
90- Then The document "engine-ayse" :"assets" :"container -unlinked1" content match:
93+ Then The document "engine-ayse" :"assets" :"Container -unlinked1" content match:
9194 | measures .temperatureExt .type | "temperature " |
9295 | measures .temperatureExt .values .temperature | 26 |
9396 When I successfully execute the action "device-manager/measures" :"push" with args:
9497 | engineId | "engine -ayse " |
95- | body .assetId | "container -unlinked1 " |
98+ | body .assetId | "Container -unlinked1 " |
9699 | body .measure .type | "temperature " |
97100 | body .measure .values .temperature | -5 |
98101 | body .measure .type | "temperature " |
99102 | body .measure .name | "temperatureInt " |
100- Then The document "engine-ayse" :"assets" :"container -unlinked1" content match:
103+ Then The document "engine-ayse" :"assets" :"Container -unlinked1" content match:
101104 | measures .temperatureInt .type | "temperature " |
102105 | measures .temperatureInt .values .temperature | -5 |
103106 | measures .temperatureExt .type | "temperature " |
104107 | measures .temperatureExt .values .temperature | 26 |
105108 When I successfully execute the action "device-manager/measures" :"push" with args:
106109 | engineId | "engine -ayse " |
107- | body .assetId | "container -unlinked1 " |
110+ | body .assetId | "Container -unlinked1 " |
108111 | body .measure .type | "temperature " |
109112 | body .measure .values .temperature | 31 |
110113 | body .measure .type | "temperature " |
111114 | body .measure .name | "temperatureExt " |
112- Then The document "engine-ayse" :"assets" :"container -unlinked1" content match:
115+ Then The document "engine-ayse" :"assets" :"Container -unlinked1" content match:
113116 | measures .temperatureExt .values .temperature | 31 |
114117 Then I count 3 documents in "engine-ayse" :"measures"
115118
116119 Scenario : Push a measure without name use measure type as name
117120 When I successfully execute the action "device-manager/measures" :"push" with args:
118121 | engineId | "engine -ayse " |
119- | body .assetId | "container -unlinked1 " |
122+ | body .assetId | "Container -unlinked1 " |
120123 | body .measure .type | "temperature " |
121124 | body .measure .values .temperature | 70 |
122125 | body .measure .name | "temperatureExt " |
123- Then The document "engine-ayse" :"assets" :"container -unlinked1" content match:
126+ Then The document "engine-ayse" :"assets" :"Container -unlinked1" content match:
124127 | measures .temperatureExt .type | "temperature " |
125128 | measures .temperatureExt .name | "temperatureExt " |
126129 | measures .temperatureExt .values .temperature | 70 |
0 commit comments