---
- config:
  - testset: "Database API Tests"
  - api: &api "database_api"
  - variable_binds:
    - api: *api
  - generators:
    - test_id: {type: 'number_sequence', start: 1}

- base_test: &base_test
  - generator_binds:
    - test_id: test_id
  - group: *api
  - url: "/"
  - method: "POST"
  - body: {template: {file: "../../templates/request_template.json"}}
  - validators:
    - extract_test: {jsonpath_mini: "error", test: "not_exists"}
    - extract_test: {jsonpath_mini: "result", test: "exists"}
    - compare: {jsonpath_mini: "id", comparator: "str_eq", expected: {template: $test_id}}
    - json_file_validator: {jsonpath_mini: "result", comparator: "json_compare", expected: {template: 'full_sync/$api/$method'}}

- test:
  - name: "list_comments"
  - variable_binds:
    - method: "list_comments"
    - args: '{"start":["steemit","firstpost"], "limit":10, "order":"by_permlink"}'
  - <<: *base_test

- test:
  - name: "find_comments"
  - variable_binds:
    - method: "find_comments"
    - args: '{"start":[["steemit","firstpost"]], "limit":10, "order":"by_author"}'
  - <<: *base_test
