1111import org .jooby .Env ;
1212import org .jooby .MockUnit ;
1313import org .jooby .Renderer ;
14- import org .jooby .View ;
1514import org .jooby .internal .ftl .Engine ;
1615import org .jooby .internal .ftl .GuavaCacheStorage ;
1716import org .junit .Test ;
2019import org .powermock .modules .junit4 .PowerMockRunner ;
2120
2221import com .google .inject .Binder ;
23- import com .google .inject .Key ;
2422import com .google .inject .binder .AnnotatedBindingBuilder ;
2523import com .google .inject .binder .LinkedBindingBuilder ;
2624import com .google .inject .multibindings .Multibinder ;
27- import com .google .inject .name .Names ;
2825import com .typesafe .config .Config ;
2926import com .typesafe .config .ConfigFactory ;
3027import com .typesafe .config .ConfigValueFactory ;
@@ -75,9 +72,8 @@ public void defaults() throws Exception {
7572 expect (binder .bind (Configuration .class )).andReturn (configBB );
7673
7774 Engine engine = unit .mockConstructor (
78- Engine .class , new Class []{Configuration .class , String .class , String .class },
79- config , prefix , suffix );
80- expect (engine .name ()).andReturn ("ftl" );
75+ Engine .class , new Class []{Configuration .class , String .class },
76+ config , suffix );
8177
8278 LinkedBindingBuilder <Renderer > ffLBB = unit .mock (LinkedBindingBuilder .class );
8379 ffLBB .toInstance (engine );
@@ -88,11 +84,6 @@ public void defaults() throws Exception {
8884 unit .mockStatic (Multibinder .class );
8985 expect (Multibinder .newSetBinder (binder , Renderer .class )).andReturn (formatter );
9086
91- LinkedBindingBuilder <View .Engine > eLBB = unit .mock (LinkedBindingBuilder .class );
92- eLBB .toInstance (engine );
93-
94- expect (binder .bind (Key .get (View .Engine .class , Names .named ("ftl" )))).andReturn (eLBB );
95-
9687 })
9788 .expect (unit -> {
9889 Env env = unit .get (Env .class );
@@ -142,9 +133,8 @@ public void defaultsNoDev() throws Exception {
142133 expect (binder .bind (Configuration .class )).andReturn (configBB );
143134
144135 Engine engine = unit .mockConstructor (
145- Engine .class , new Class []{Configuration .class , String .class , String .class },
146- config , prefix , suffix );
147- expect (engine .name ()).andReturn ("ftl" );
136+ Engine .class , new Class []{Configuration .class , String .class },
137+ config , suffix );
148138
149139 LinkedBindingBuilder <Renderer > ffLBB = unit .mock (LinkedBindingBuilder .class );
150140 ffLBB .toInstance (engine );
@@ -155,11 +145,6 @@ public void defaultsNoDev() throws Exception {
155145 unit .mockStatic (Multibinder .class );
156146 expect (Multibinder .newSetBinder (binder , Renderer .class )).andReturn (formatter );
157147
158- LinkedBindingBuilder <View .Engine > eLBB = unit .mock (LinkedBindingBuilder .class );
159- eLBB .toInstance (engine );
160-
161- expect (binder .bind (Key .get (View .Engine .class , Names .named ("ftl" )))).andReturn (eLBB );
162-
163148 })
164149 .expect (unit -> {
165150 Env env = unit .get (Env .class );
@@ -239,9 +224,8 @@ public void withPrefix() throws Exception {
239224 expect (binder .bind (Configuration .class )).andReturn (configBB );
240225
241226 Engine engine = unit .mockConstructor (
242- Engine .class , new Class []{Configuration .class , String .class , String .class },
243- config , prefix , suffix );
244- expect (engine .name ()).andReturn ("ftl" );
227+ Engine .class , new Class []{Configuration .class , String .class },
228+ config , suffix );
245229
246230 LinkedBindingBuilder <Renderer > ffLBB = unit .mock (LinkedBindingBuilder .class );
247231 ffLBB .toInstance (engine );
@@ -252,11 +236,6 @@ public void withPrefix() throws Exception {
252236 unit .mockStatic (Multibinder .class );
253237 expect (Multibinder .newSetBinder (binder , Renderer .class )).andReturn (formatter );
254238
255- LinkedBindingBuilder <View .Engine > eLBB = unit .mock (LinkedBindingBuilder .class );
256- eLBB .toInstance (engine );
257-
258- expect (binder .bind (Key .get (View .Engine .class , Names .named ("ftl" )))).andReturn (eLBB );
259-
260239 })
261240 .expect (unit -> {
262241 Env env = unit .get (Env .class );
@@ -304,9 +283,8 @@ public void withPrefixAndSuffix() throws Exception {
304283 expect (binder .bind (Configuration .class )).andReturn (configBB );
305284
306285 Engine engine = unit .mockConstructor (
307- Engine .class , new Class []{Configuration .class , String .class , String .class },
308- config , prefix , suffix );
309- expect (engine .name ()).andReturn ("ftl" );
286+ Engine .class , new Class []{Configuration .class , String .class },
287+ config , suffix );
310288
311289 LinkedBindingBuilder <Renderer > ffLBB = unit .mock (LinkedBindingBuilder .class );
312290 ffLBB .toInstance (engine );
@@ -317,11 +295,6 @@ public void withPrefixAndSuffix() throws Exception {
317295 unit .mockStatic (Multibinder .class );
318296 expect (Multibinder .newSetBinder (binder , Renderer .class )).andReturn (formatter );
319297
320- LinkedBindingBuilder <View .Engine > eLBB = unit .mock (LinkedBindingBuilder .class );
321- eLBB .toInstance (engine );
322-
323- expect (binder .bind (Key .get (View .Engine .class , Names .named ("ftl" )))).andReturn (eLBB );
324-
325298 })
326299 .expect (unit -> {
327300 Env env = unit .get (Env .class );
@@ -371,9 +344,8 @@ public void withConfigurer() throws Exception {
371344 expect (binder .bind (Configuration .class )).andReturn (configBB );
372345
373346 Engine engine = unit .mockConstructor (
374- Engine .class , new Class []{Configuration .class , String .class , String .class },
375- config , prefix , suffix );
376- expect (engine .name ()).andReturn ("ftl" );
347+ Engine .class , new Class []{Configuration .class , String .class },
348+ config , suffix );
377349
378350 LinkedBindingBuilder <Renderer > ffLBB = unit .mock (LinkedBindingBuilder .class );
379351 ffLBB .toInstance (engine );
@@ -383,12 +355,6 @@ public void withConfigurer() throws Exception {
383355
384356 unit .mockStatic (Multibinder .class );
385357 expect (Multibinder .newSetBinder (binder , Renderer .class )).andReturn (formatter );
386-
387- LinkedBindingBuilder <View .Engine > eLBB = unit .mock (LinkedBindingBuilder .class );
388- eLBB .toInstance (engine );
389-
390- expect (binder .bind (Key .get (View .Engine .class , Names .named ("ftl" )))).andReturn (eLBB );
391-
392358 })
393359 .expect (unit -> {
394360 Env env = unit .get (Env .class );
0 commit comments