@@ -524,6 +524,7 @@ public Object m1() {
524524 expect (injector .getInstance (Route .KEY )).andReturn (Collections .emptySet ());
525525 expect (injector .getInstance (WebSocket .KEY )).andReturn (Collections .emptySet ());
526526 injector .injectMembers (isA (Jooby .class ));
527+ unit .registerMock (Injector .class , injector );
527528
528529 AppPrinter printer = unit .constructor (AppPrinter .class )
529530 .args (Set .class , Set .class , Config .class )
@@ -2062,7 +2063,8 @@ public void assets() throws Exception {
20622063 .expect (requestScope )
20632064 .expect (webSockets )
20642065 .expect (tmpdir )
2065- .expect (err ).expect (executor ("deferred" ))
2066+ .expect (err )
2067+ .expect (executor ("deferred" ))
20662068 .expect (unit -> {
20672069 Mutant ifModifiedSince = unit .mock (Mutant .class );
20682070 expect (ifModifiedSince .toOptional (Long .class )).andReturn (Optional .empty ());
@@ -2084,6 +2086,15 @@ public void assets() throws Exception {
20842086 Route .Chain chain = unit .get (Route .Chain .class );
20852087 chain .next (req , rsp );
20862088 })
2089+ .expect (unit -> {
2090+ Config conf = unit .get (Config .class );
2091+ expect (conf .getString ("assets.cdn" )).andReturn ("" ).times (2 );
2092+ expect (conf .getBoolean ("assets.lastModified" )).andReturn (true ).times (2 );
2093+ expect (conf .getBoolean ("assets.etag" )).andReturn (true ).times (2 );
2094+
2095+ Injector injector = unit .get (Injector .class );
2096+ expect (injector .getInstance (Key .get (Config .class ))).andReturn (conf ).times (2 );
2097+ })
20872098 .run (unit -> {
20882099 Jooby jooby = new Jooby ();
20892100
@@ -2259,32 +2270,32 @@ public void ws() throws Exception {
22592270 .expect (routeHandler )
22602271 .expect (params )
22612272 .expect (requestScope )
2262- .expect (
2263- unit -> {
2264- Multibinder <WebSocket .Definition > multibinder = unit .mock (Multibinder .class );
2273+ .expect (unit -> {
2274+ Multibinder <WebSocket .Definition > multibinder = unit .mock (Multibinder .class );
22652275
2266- LinkedBindingBuilder <WebSocket .Definition > binding = unit
2267- .mock (LinkedBindingBuilder .class );
2268- binding .toInstance (unit .capture (WebSocket .Definition .class ));
2276+ LinkedBindingBuilder <WebSocket .Definition > binding = unit
2277+ .mock (LinkedBindingBuilder .class );
2278+ binding .toInstance (unit .capture (WebSocket .Definition .class ));
22692279
2270- expect (multibinder .addBinding ()).andReturn (binding );
2280+ expect (multibinder .addBinding ()).andReturn (binding );
22712281
2272- Binder binder = unit .get (Binder .class );
2282+ Binder binder = unit .get (Binder .class );
22732283
2274- expect (Multibinder .newSetBinder (binder , WebSocket .Definition .class )).andReturn (
2275- multibinder );
2276- })
2284+ expect (Multibinder .newSetBinder (binder , WebSocket .Definition .class )).andReturn (
2285+ multibinder );
2286+ })
22772287 .expect (tmpdir )
2278- .expect (err ).expect (executor ("deferred" ))
2288+ .expect (err )
2289+ .expect (executor ("deferred" ))
22792290 .run (unit -> {
22802291
22812292 Jooby jooby = new Jooby ();
22822293
22832294 WebSocket .Definition ws = jooby .ws ("/" , (socket ) -> {
22842295 });
22852296 assertEquals ("/" , ws .pattern ());
2286- assertEquals (MediaType .all , ws .consumes ());
2287- assertEquals (MediaType .all , ws .produces ());
2297+ assertEquals (MediaType .plain , ws .consumes ());
2298+ assertEquals (MediaType .plain , ws .produces ());
22882299 defs .add (ws );
22892300
22902301 jooby .start ();
0 commit comments