1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.mybatis.scripting.freemarker;
17
18 import org.junit.jupiter.api.Assertions;
19 import org.junit.jupiter.api.Test;
20
21 class InvalidFreeMarkerSettingTest {
22
23 @Test
24 void unknownSetting() {
25
26 String message = Assertions.assertThrows(IllegalStateException.class, () -> {
27 new FreeMarkerLanguageDriver(
28 FreeMarkerLanguageDriverConfig.newInstance(c -> c.getFreemarkerSettings().put("foo", "bar")));
29 }).getMessage();
30 Assertions.assertEquals("Fail to configure FreeMarker template setting. name[foo] value[bar]", message);
31 }
32
33 }