RestSettingsModule implements SettingsModule { @Override public Call<Object> switchLanguage(Language language) { return service.switchLanguage(new SwitchLanguageController(language.getId())) .map(data -> data); } @Inject  RestSettingsModule(RestService service, AccountModule accountModule); @Override Call<UserData> loadUserData(); @Override Call<Object> switchLanguage(Language language);  }
@Test public void switchLanguage() { Language language = Language.create("id", "lang", 0, true, true); when(service.switchLanguage(any(SwitchLanguageController.class))).thenReturn(Call.just(null)); TestObserver<Object> observer = new TestObserver<>(); module.switchLanguage(language).enqueue(observer); observer.assertOnNextCalled(); }