---
setup:
  - do:
      something:
        here: ok
---
teardown:
  - do:
      something_else:
        here: true
---
"First test":

  - do:
      something:
        that_is: true

  - do:
      and: again

  - do:
      deep:
        key: "below"
        body:
          actions:
            output:
              webhook:
                a: "b"
                key_to_replace: "value_to_replace"


  - key_not_to_replace: { copied.from.real.test.total: 1 }
  - key_not_to_replace: { hits.hits.0._index: "single_doc_index"}
  - key_not_to_replace: { _shards.total: 2 }
  - key_not_to_replace: { _shards.successful: 2 }
  - key_not_to_replace: { _shards.skipped : 0}
  - key_not_to_replace: { _shards.failed: 0 }

  - do:
      and: again

  - key_not_to_replace: { hits.total: 1 }
  - key_not_to_replace: { hits.hits.0._index: "my_remote_cluster:single_doc_index"}
  - key_not_to_replace: { _shards.total: 2 }
  - key_not_to_replace: { _shards.successful: 2 }
  - key_not_to_replace: { _shards.skipped : 0}
  - key_not_to_replace: { _below_is_target_for_tests: 0 }
  - key_to_replace: "value_to_replace"
  - is_true: is_true_to_replace
  - is_false: is_false_to_replace

---
"Also has key_value to replace":

  - do:
      something:
        that_is: true

  - do:
      and: again

  - key_not_to_replace: { hits.total.value: 0 }
  - key_to_replace: "value_to_replace"
  - key_not_to_replace: { _below_is_target_for_tests: 0 }
  - key_not_to_replace: { _type: foo }
  - key_not_to_replace: { _shards.total: 2 }
  - key_not_to_replace: { _shards.successful: 2 }
  - key_not_to_replace: { _shards.skipped : 1}
  - key_not_to_replace: { _shards.failed: 0 }

  - do:
      not_random_but_representive: "of actual test"

  - key_not_to_replace: { hits.total.value: 0 }
  - key_not_to_replace: { _shards.total: 2 }
  - key_not_to_replace: { _shards.successful: 2 }
  - key_not_to_replace: { _shards.skipped : 1}
  - key_not_to_replace: { _shards.failed: 0 }

---
"Does not have key_value to replace ":

  - do:
      something:
        that_is: true

  - do:
      and: again

  - key_to_replace: "value_NOT_to_replace"

  - do:
      it: again

  - key_not_to_replace: { _type: 0 }
  - key_not_to_replace: { _shards.total: 2 }

---
"Last test":

  - do:
      something:  中文

  - key_not_to_replace: { _index:   test_1 }
  - key_to_replace: "value_to_replace"
  - key_not_to_replace: { _id:      中文      }
  - key_not_to_replace: { _source:  { foo: "Hello: 中文" } }

  - do:
      something_else:  中文

  - key_not_to_replace: { _index:   test_1 }
  - key_not_to_replace: { _type:    "the value does not matter" }
  - key_not_to_replace: { _id:      中文      }
  - key_not_to_replace: { _source:  { foo: "Hello: 中文" } }
