Skip to content

Commit

Permalink
Change exception message for missing Thymeleaf templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Syer committed Mar 5, 2014
1 parent 6b83e0a commit ffe91ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@ public void checkTemplateLocationExists() {
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)");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -95,8 +95,8 @@ public void templateLocationDoesNotExist() throws Exception {
}

@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,
Expand Down

0 comments on commit ffe91ca

Please sign in to comment.