Consistent ScriptTemplateView locale resolution via request

Issue: SPR-15064
This commit is contained in:
Juergen Hoeller
2017-06-26 23:28:49 +02:00
parent 41eaf03bc8
commit 98642c7e29
8 changed files with 24 additions and 59 deletions

View File

@@ -78,8 +78,7 @@ public class KotlinScriptTemplateTests {
private MockServerHttpResponse renderViewWithModel(String viewUrl, Map<String, Object> model, Locale locale, Class<?> configuration) throws Exception {
ScriptTemplateView view = createViewWithUrl(viewUrl, configuration);
view.setLocale(locale);
MockServerWebExchange exchange = MockServerHttpRequest.get("/").toExchange();
MockServerWebExchange exchange = MockServerHttpRequest.get("/").acceptLanguageAsLocales(locale).toExchange();
view.renderInternal(model, MediaType.TEXT_HTML, exchange).block();
return exchange.getResponse();
}