77import java .io .FileNotFoundException ;
88import java .io .StringWriter ;
99import java .util .HashMap ;
10+ import java .util .Locale ;
1011import java .util .Map ;
1112
1213import org .jooby .MediaType ;
@@ -31,12 +32,15 @@ public class Issue725 {
3132 public void templateNotFound () throws Exception {
3233 new MockUnit (PebbleEngine .class , View .class , Renderer .Context .class )
3334 .expect (unit -> {
35+ Locale locale = Locale .ENGLISH ;
3436 Map vmodel = unit .mock (Map .class );
3537 Map <String , Object > locals = unit .mock (Map .class );
38+ expect (locals .getOrDefault ("locale" , locale )).andReturn (locale );
3639
3740 Map model = unit .constructor (HashMap .class ).build ();
3841 model .putAll (locals );
3942 expect (model .putIfAbsent ("_vname" , "vname" )).andReturn (null );
43+ expect (model .putIfAbsent ("locale" , locale )).andReturn (null );
4044 model .putAll (vmodel );
4145
4246 View view = unit .get (View .class );
@@ -47,11 +51,12 @@ public void templateNotFound() throws Exception {
4751
4852 Renderer .Context ctx = unit .get (Renderer .Context .class );
4953 expect (ctx .locals ()).andReturn (locals );
54+ expect (ctx .locale ()).andReturn (locale );
5055 expect (ctx .type (MediaType .html )).andReturn (ctx );
5156 ctx .send (writer .toString ());
5257
5358 PebbleTemplate template = unit .mock (PebbleTemplate .class );
54- template .evaluate (writer , model );
59+ template .evaluate (writer , model , locale );
5560 LoaderException x = new LoaderException (null , "template not found" );
5661 expectLastCall ().andThrow (x );
5762
0 commit comments