diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java index bc5dbd49755..85ee78d33e5 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java @@ -84,8 +84,11 @@ public class ThymeleafAutoConfiguration { if (checkTemplateLocation) { Resource resource = this.resourceLoader.getResource(this.environment .getProperty("prefix", DEFAULT_PREFIX)); - Assert.state(resource.exists(), "Cannot find template location: " - + resource + " (are you really using Thymeleaf?)"); + Assert.state( + resource.exists(), + "Cannot find template location: " + + resource + + " (please add some templates or check your Thymeleaf configuration)"); } } diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfigurationTests.java index 59ea1ae7e36..1e7288d7542 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfigurationTests.java @@ -16,11 +16,11 @@ package org.springframework.boot.autoconfigure.thymeleaf; +import java.io.File; import java.util.Collections; import java.util.Locale; import org.junit.After; -import org.junit.Ignore; import org.junit.Test; import org.springframework.beans.factory.BeanCreationException; import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration; @@ -95,8 +95,8 @@ public class ThymeleafAutoConfigurationTests { } @Test - @Ignore("Fix this for gh-424") public void templateLocationEmpty() throws Exception { + new File("target/test-classes/templates/empty-directory").mkdir(); EnvironmentTestUtils.addEnvironment(this.context, "spring.thymeleaf.prefix:classpath:/templates/empty-directory/"); this.context.register(ThymeleafAutoConfiguration.class,