@Test public void testProvideChatServices() { when(networkServiceMock.createService(ChatService.class)).thenReturn(chatServiceMock); assertEquals(chatServiceMock, applicationModule.provideChatService(networkServiceMock)); }
@Provides @ApplicationScope public ChatService provideChatService(NetworkService networkService) { return networkService.createService(ChatService.class); }
ApplicationModule { @Provides @ApplicationScope public ChatService provideChatService(NetworkService networkService) { return networkService.createService(ChatService.class); } }
ApplicationModule { @Provides @ApplicationScope public ChatService provideChatService(NetworkService networkService) { return networkService.createService(ChatService.class); } ApplicationModule(Context context); }
ApplicationModule { @Provides @ApplicationScope public ChatService provideChatService(NetworkService networkService) { return networkService.createService(ChatService.class); } ApplicationModule(Context context); @Provides @ApplicationScope NetworkService provideNetworkService(OkHttpClient okHttpClient, GsonConverterFactory gsonConverterFactory); @Provides @ApplicationScope ChatService provideChatService(NetworkService networkService); @Provides @ApplicationScope OkHttpClient provideOkHttpClient(); @Provides @ApplicationScope GsonConverterFactory provideGsonConverterFactory(); }
ApplicationModule { @Provides @ApplicationScope public ChatService provideChatService(NetworkService networkService) { return networkService.createService(ChatService.class); } ApplicationModule(Context context); @Provides @ApplicationScope NetworkService provideNetworkService(OkHttpClient okHttpClient, GsonConverterFactory gsonConverterFactory); @Provides @ApplicationScope ChatService provideChatService(NetworkService networkService); @Provides @ApplicationScope OkHttpClient provideOkHttpClient(); @Provides @ApplicationScope GsonConverterFactory provideGsonConverterFactory();  }