Search in sources :

Example 1 with MustacheException

use of com.github.mustachejava.MustacheException in project elasticsearch by elastic.

the class MustacheTests method testsUnsupportedTagsJoin.

public void testsUnsupportedTagsJoin() {
    MustacheException e = expectThrows(MustacheException.class, () -> compile("{{#join}}{{/join}}"));
    assertThat(e.getMessage(), containsString("Mustache function [join] must contain one and only one identifier"));
    e = expectThrows(MustacheException.class, () -> compile("{{#join delimiter='a'}}{{/join delimiter='b'}}"));
    assertThat(e.getMessage(), containsString("Mismatched start/end tags"));
}
Also used : MustacheException(com.github.mustachejava.MustacheException)

Example 2 with MustacheException

use of com.github.mustachejava.MustacheException in project elasticsearch by elastic.

the class MustacheTests method testsUnsupportedTagsToJson.

public void testsUnsupportedTagsToJson() {
    MustacheException e = expectThrows(MustacheException.class, () -> compile("{{#toJson}}{{foo}}{{bar}}{{/toJson}}"));
    assertThat(e.getMessage(), containsString("Mustache function [toJson] must contain one and only one identifier"));
    e = expectThrows(MustacheException.class, () -> compile("{{#toJson}}{{/toJson}}"));
    assertThat(e.getMessage(), containsString("Mustache function [toJson] must contain one and only one identifier"));
}
Also used : MustacheException(com.github.mustachejava.MustacheException)

Aggregations

MustacheException (com.github.mustachejava.MustacheException)2