2525import java .util .Map ;
2626
2727import groovy .text .markup .BaseTemplate ;
28+ import groovy .text .markup .DelegatingIndentWriter ;
2829import groovy .text .markup .MarkupTemplateEngine ;
2930import groovy .text .markup .TemplateConfiguration ;
3031import jakarta .servlet .http .HttpServletRequest ;
@@ -159,9 +160,16 @@ void customSuffix() throws Exception {
159160 assertThat (result ).contains ("suffixed" );
160161 }
161162
163+ @ Test
164+ void defaultResourceLoaderPath () throws Exception {
165+ registerAndRefreshContext ();
166+ assertThat (this .context .getBean (GroovyMarkupConfigurer .class ).getResourceLoaderPath ())
167+ .isEqualTo (GroovyTemplateProperties .DEFAULT_RESOURCE_LOADER_PATH );
168+ }
169+
162170 @ Test
163171 @ WithResource (name = "custom-templates/custom.tpl" , content = "yield \" custom\" " )
164- void customTemplateLoaderPath () throws Exception {
172+ void customResourceLoaderPath () throws Exception {
165173 registerAndRefreshContext ("spring.groovy.template.resource-loader-path:classpath:/custom-templates/" );
166174 MockHttpServletResponse response = render ("custom" );
167175 String result = response .getContentAsString ();
@@ -199,6 +207,13 @@ void enableAutoIndent() {
199207 assertThat (this .context .getBean (GroovyMarkupConfigurer .class ).isAutoIndent ()).isTrue ();
200208 }
201209
210+ @ Test
211+ void defaultAutoIndentString () {
212+ registerAndRefreshContext ();
213+ assertThat (this .context .getBean (GroovyMarkupConfigurer .class ).getAutoIndentString ())
214+ .isEqualTo (DelegatingIndentWriter .SPACES );
215+ }
216+
202217 @ Test
203218 void customAutoIndentString () {
204219 registerAndRefreshContext ("spring.groovy.template.auto-indent-string:\\ t" );
@@ -211,13 +226,26 @@ void enableAutoNewLine() {
211226 assertThat (this .context .getBean (GroovyMarkupConfigurer .class ).isAutoNewLine ()).isTrue ();
212227 }
213228
229+ @ Test
230+ void defaultBaseTemplateClass () {
231+ registerAndRefreshContext ();
232+ assertThat (this .context .getBean (GroovyMarkupConfigurer .class ).getBaseTemplateClass ())
233+ .isEqualTo (BaseTemplate .class );
234+ }
235+
214236 @ Test
215237 void customBaseTemplateClass () {
216238 registerAndRefreshContext ("spring.groovy.template.base-template-class:" + CustomBaseTemplate .class .getName ());
217239 assertThat (this .context .getBean (GroovyMarkupConfigurer .class ).getBaseTemplateClass ())
218240 .isEqualTo (CustomBaseTemplate .class );
219241 }
220242
243+ @ Test
244+ void defaultDeclarationEncoding () {
245+ registerAndRefreshContext ();
246+ assertThat (this .context .getBean (GroovyMarkupConfigurer .class ).getDeclarationEncoding ()).isNull ();
247+ }
248+
221249 @ Test
222250 void customDeclarationEncoding () {
223251 registerAndRefreshContext ("spring.groovy.template.declaration-encoding:UTF-8" );
@@ -230,12 +258,25 @@ void enableExpandEmptyElements() {
230258 assertThat (this .context .getBean (GroovyMarkupConfigurer .class ).isExpandEmptyElements ()).isTrue ();
231259 }
232260
261+ @ Test
262+ void defaultLocale () {
263+ registerAndRefreshContext ();
264+ assertThat (this .context .getBean (GroovyMarkupConfigurer .class ).getLocale ()).isEqualTo (Locale .getDefault ());
265+ }
266+
233267 @ Test
234268 void customLocale () {
235269 registerAndRefreshContext ("spring.groovy.template.locale:en_US" );
236270 assertThat (this .context .getBean (GroovyMarkupConfigurer .class ).getLocale ()).isEqualTo (Locale .US );
237271 }
238272
273+ @ Test
274+ void defaultNewLineString () {
275+ registerAndRefreshContext ();
276+ assertThat (this .context .getBean (GroovyMarkupConfigurer .class ).getNewLineString ())
277+ .isEqualTo (System .lineSeparator ());
278+ }
279+
239280 @ Test
240281 void customNewLineString () {
241282 registerAndRefreshContext ("spring.groovy.template.new-line-string:\\ r\\ n" );
0 commit comments