ЕСОЗ - публічна документація
Dictionary Tests
n/n | description | inputs | expected_result | actual_result |
---|---|---|---|---|
1 | Insert dictionary with existed ID | duplicated id | ERROR: duplicate key value violates unique constraint "dictionaries_pkey" Detail: Key (id)=(f98c9549-cdef-4df3-af2f-a8f8260c7a88) already exists. | ERROR: duplicate key value violates unique constraint "dictionaries_pkey" Detail: Key (id)=(f98c9549-cdef-4df3-af2f-a8f8260c7a88) already exists. |
2 | Insert dictionary with existed name | duplicated name | ERROR: duplicate key value violates unique constraint "dictionaries_name_uniq" Detail: Key (name)=(TEST) already exists. | ERROR: duplicate key value violates unique constraint "dictionaries_name_uniq" Detail: Key (name)=(TEST) already exists. |
3 | Update dictionary with existed name | "input": { "id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODg=", "name": "COUNTRY", "isActive": true } | 422, Dictionary with such name already exists | UNPROCESSABLE_ENTITY Name can't be changed |
4 | Update not active dictionary | 422, Dictionary is not active | UNPROCESSABLE_ENTITY Deactivated dictionary is not allowed to be updated | |
5 | Update dictionary with empty values | { "input": { "id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODg=", "values": "{}" } } | UNPROCESSABLE_ENTITY, "description": "Values should not be empty" | UNPROCESSABLE_ENTITY, "description": "Values should not be empty" |
6 | Update dictionary with empty labels | "input": { "id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODg=", "labels": [] } | UNPROCESSABLE_ENTITY "description": "Labels should not be empty" | 200, labels are updated to empty |
7 | Update dictionary add few same keys | { "input": { "id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODg=", "values": "{\"one\":\"два\",\"one\":\"один\"}" } } | 422, Keys are duplicated | 200, first values is inserted |
8 | Update dictionary add few same tags | "input": { "id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODg=", "labels": ["SYSTEM", "SYSTEM"] } | 422, Labels are duplicated | UNPROCESSABLE_ENTITY Labels are duplicated |
9 | Update dictionary by ID which doesn't exist | "input": { "id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODc=" } | NOT_FOUND Dictionary not found | NOT_FOUND Dictionary not found |
10 | Deactivate dictionary | "input": { "id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODg=", "isActive": false } | "Argument \"input\" has invalid value $input.\nIn field \"isActive\": Unknown field." | "Argument \"input\" has invalid value $input.\nIn field \"isActive\": Unknown field." |
11 | Activate deactivated dictionary | "input": { "id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODg=", "isActive": true } | "Argument \"input\" has invalid value $input.\nIn field \"isActive\": Unknown field." | "Argument \"input\" has invalid value $input.\nIn field \"isActive\": Unknown field." |
12 | Rename dictionary | "input": { "id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODg=", "name": "TEST1" } | 422, Name can't be changed | UNPROCESSABLE_ENTITY Name can't be changed |
13 | Filter dictionaries by tag | "filter": { "label": "SYSTEM" } | 200, filtered by label | 200, filtered by label |
14 | Filter dictionaries by name | "filter": { "name": "test" } | 200, filtered by name | 200, filtered by name |
15 | Filter dictionaries by values.key | |||
16 | Filter dictionaries by is_active | "filter": { "isActive": true } | 200, filtered by isActive | 200, filtered by isActive |
ЕСОЗ - публічна документація