title: How to disable Thymeleaf in Spring MVC tests?
body: <p>I'm trying to test my Spring MVC controller, but I keep getting errors related to Thymeleaf templates. I really don't want deal with template errors in the controller test since that's not really what I'm interested in. Having the tests fail when templates don't exist is ok, but right now I'm getting errors relating to messages not being found based on error code.</p>
  
  <pre><code>Caused by: org.springframework.context.NoSuchMessageException: No message found under code 'Pattern.book.name' for locale 'en'.
      at org.springframework.context.support.DelegatingMessageSource.getMessage(DelegatingMessageSource.java:84)
      at org.springframework.context.support.AbstractApplicationContext.getMessage(AbstractApplicationContext.java:1264)
      at org.springframework.web.servlet.support.RequestContext.getMessage(RequestContext.java:733)
      at org.springframework.web.servlet.support.BindStatus.initErrorMessages(BindStatus.java:181)
      at org.springframework.web.servlet.support.BindStatus.getErrorMessages(BindStatus.java:277)
      at org.thymeleaf.spring4.processor.attr.SpringErrorsAttrProcessor.processAttribute(SpringErrorsAttrProcessor.java:82)
      at org.thymeleaf.processor.attr.AbstractAttrProcessor.doProcess(AbstractAttrProcessor.java:87)
      at org.thymeleaf.processor.AbstractProcessor.process(AbstractProcessor.java:212)
      ... 119 more
  </code></pre>
  
  <p>This problem does not exist when I run the application. I've been trying to figure out how to set up the test environment to resolve this, but there I can't find anything that works. Right now, I'm just really trying to get the controller code working properly.</p>