ArcBees / Jukito

The combined power of JUnit, Guice and Mockito. Plus it sounds like a cool martial art.

Home Page:http://jukito.arcbees.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using requestStaticInjection doesn't inject mock as expected

christiangoudreau opened this issue · comments

In the code snippet bellow, we need to manually provide binding for all abstraction.

   public static class Module extends JukitoModule {
        @Override
        protected void configureTest() {
            requestStaticInjection(AbstractAsyncCallback.class);
        }

        @Provides
        @Singleton
        private Console getConsole() {
            return mock(Console.class);
        }

        @Provides
        @Singleton
        private EventBus getEventbus() {
            return mock(EventBus.class);
        }

        @Provides
        @Singleton
        private ResMessages getResMessage() {
            return mock(ResMessages.class);
        }

        @Provides
        @Singleton
        private PlaceManager getPlaceManager() {
            return mock(PlaceManager.class);
        }
    }