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);
}