---
- 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: "/rpc"
  - method: "POST"
  - body: {template: {file: "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: '$api/$method'}}

- test:
  - name: "get_dynamic_global_properties"
  - variable_binds:
    - method: "get_dynamic_global_properties"
    - args: {}
  - <<: *base_test

- test:
  - name: "get_config"
  - variable_binds:
    - method: "get_config"
    - args: {}
  - <<: *base_test

- test:
  - name: "get_witness_schedule"
  - variable_binds:
    - method: "get_witness_schedule"
    - args: {}
  - <<: *base_test

- test:
  - name: "get_hardfork_properties"
  - variable_binds:
    - method: "get_hardfork_properties"
    - args: {}
  - <<: *base_test

- test:
  - name: "get_reward_funds"
  - variable_binds:
    - method: "get_reward_funds"
    - args: {}
  - <<: *base_test

- test:
  - name: "get_current_price_feed"
  - variable_binds:
    - method: "get_current_price_feed"
    - args: {}
  - <<: *base_test

- test:
  - name: "get_feed_history"
  - variable_binds:
    - method: "get_feed_history"
    - args: {}
  - <<: *base_test

- test:
  - name: "list_witnesses"
  - variable_binds:
    - method: "get_feed_history"
    - args: '{ "start": 0, "limit": 1, "order": "by_name" }'
  - <<: *base_test
