@@ -2704,17 +2704,16 @@ public void useConfig() throws Exception {
27042704 .expect (webSockets )
27052705 .expect (tmpdir )
27062706 .expect (err )
2707- .expect (
2708- unit -> {
2709- AnnotatedBindingBuilder <List <Integer >> listAnnotatedBinding = unit
2710- .mock (AnnotatedBindingBuilder .class );
2711- listAnnotatedBinding .toInstance (Arrays .asList (1 , 2 , 3 ));
2707+ .expect (unit -> {
2708+ AnnotatedBindingBuilder <List <Integer >> listAnnotatedBinding = unit
2709+ .mock (AnnotatedBindingBuilder .class );
2710+ listAnnotatedBinding .toInstance (Arrays .asList (1 , 2 , 3 ));
27122711
2713- Binder binder = unit .get (Binder .class );
2714- Key <List <Integer >> key = (Key <List <Integer >>) Key .get (Types .listOf (Integer .class ),
2715- Names .named ("list" ));
2716- expect (binder .bind (key )).andReturn (listAnnotatedBinding );
2717- })
2712+ Binder binder = unit .get (Binder .class );
2713+ Key <List <Integer >> key = (Key <List <Integer >>) Key .get (Types .listOf (Integer .class ),
2714+ Names .named ("list" ));
2715+ expect (binder .bind (key )).andReturn (listAnnotatedBinding );
2716+ })
27182717 .run (unit -> {
27192718
27202719 Jooby jooby = new Jooby ();
@@ -2726,6 +2725,80 @@ public void useConfig() throws Exception {
27262725 }, boot );
27272726 }
27282727
2728+ @ Test
2729+ public void customConf () throws Exception {
2730+
2731+ new MockUnit (Binder .class )
2732+ .expect (guice )
2733+ .expect (shutdown )
2734+ .expect (config )
2735+ .expect (env )
2736+ .expect (classInfo )
2737+ .expect (ssl )
2738+ .expect (charset )
2739+ .expect (locale )
2740+ .expect (zoneId )
2741+ .expect (timeZone )
2742+ .expect (dateTimeFormatter )
2743+ .expect (numberFormat )
2744+ .expect (decimalFormat )
2745+ .expect (renderers )
2746+ .expect (session )
2747+ .expect (routes )
2748+ .expect (routeHandler )
2749+ .expect (params )
2750+ .expect (requestScope )
2751+ .expect (webSockets )
2752+ .expect (tmpdir )
2753+ .expect (err )
2754+ .run (unit -> {
2755+
2756+ Jooby jooby = new Jooby ();
2757+
2758+ jooby .conf ("JoobyTest.conf" );
2759+
2760+ jooby .start ();
2761+
2762+ }, boot );
2763+ }
2764+
2765+ @ Test
2766+ public void customConfFile () throws Exception {
2767+
2768+ new MockUnit (Binder .class )
2769+ .expect (guice )
2770+ .expect (shutdown )
2771+ .expect (config )
2772+ .expect (env )
2773+ .expect (classInfo )
2774+ .expect (ssl )
2775+ .expect (charset )
2776+ .expect (locale )
2777+ .expect (zoneId )
2778+ .expect (timeZone )
2779+ .expect (dateTimeFormatter )
2780+ .expect (numberFormat )
2781+ .expect (decimalFormat )
2782+ .expect (renderers )
2783+ .expect (session )
2784+ .expect (routes )
2785+ .expect (routeHandler )
2786+ .expect (params )
2787+ .expect (requestScope )
2788+ .expect (webSockets )
2789+ .expect (tmpdir )
2790+ .expect (err )
2791+ .run (unit -> {
2792+
2793+ Jooby jooby = new Jooby ();
2794+
2795+ jooby .conf (new File ("JoobyTest.conf" ));
2796+
2797+ jooby .start ();
2798+
2799+ }, boot );
2800+ }
2801+
27292802 @ Test
27302803 public void useMissingConfig () throws Exception {
27312804
0 commit comments