@@ -2,22 +2,49 @@ Feature: Use an entity or document transformer to return the correct ressource
22
33 @createSchema
44 @!mongodb
5- Scenario : Get collection from entities
5+ Scenario : Get transformed collection from entities
66 Given there is a TransformedDummy for date '2025-01-01'
77 When I send a "GET" request to "/transformed_dummy_entity_ressources"
88 Then the response status code should be 200
99 And the response should be in JSON
1010 And the JSON node "hydra:totalItems" should be equal to 1
1111
1212 @!mongodb
13- Scenario : Get item from entity
13+ Scenario : Get transform item from entity
1414 Given there is a TransformedDummy for date '2025-01-01'
1515 When I send a "GET" request to "/transformed_dummy_entity_ressources/1"
1616 Then the response status code should be 200
1717 And the response should be in JSON
1818 And the JSON node "year" should exist
1919 And the JSON node year should be equal to "2025"
2020
21+ @!mongodb
22+ Scenario : Post new entity from transformed resource
23+ Given I add "Content-type" header equal to "application/ld+json"
24+ When I send a "POST" request to "/transformed_dummy_entity_ressources" with body:
25+ """
26+ {
27+ "year" : 2020
28+ }
29+ """
30+ Then the response status code should be 201
31+ And the response should be in JSON
32+ And the JSON node "year" should be equal to "2020"
33+
34+ @!mongodb
35+ Scenario : Patch entity from transformed resource
36+ Given there is a TransformedDummy for date '2025-01-01'
37+ And I add "Content-type" header equal to "application/merge-patch+json"
38+ When I send a "PATCH" request to "/transformed_dummy_entity_ressources/1" with body:
39+ """
40+ {
41+ "year" : 2020
42+ }
43+ """
44+ Then the response status code should be 200
45+ And the response should be in JSON
46+ And the JSON node "year" should be equal to "2020"
47+
2148 @createSchema
2249 @mongodb
2350 Scenario : Get collection from documents
0 commit comments