Search in sources :

Example 1 with Stash

use of org.elasticsearch.test.rest.yaml.Stash in project elasticsearch by elastic.

the class StashTests method testReplaceStashedValuesEmbeddedStashKey.

public void testReplaceStashedValuesEmbeddedStashKey() throws IOException {
    Stash stash = new Stash();
    stash.stashValue("stashed", "bar");
    Map<String, Object> expected = new HashMap<>();
    expected.put("key", singletonMap("a", "foobar"));
    Map<String, Object> map = new HashMap<>();
    Map<String, Object> map2 = new HashMap<>();
    map2.put("a", "foo${stashed}");
    map.put("key", map2);
    Map<String, Object> actual = stash.replaceStashedValues(map);
    assertEquals(expected, actual);
}
Also used : Stash(org.elasticsearch.test.rest.yaml.Stash) HashMap(java.util.HashMap)

Aggregations

HashMap (java.util.HashMap)1 Stash (org.elasticsearch.test.rest.yaml.Stash)1