@Test public void unsupportedCoordinates() { mInterceptor.setFile("unsupported-coordinates.json") .setCode(404); assertError(mPrayerClient.getPrayerTimesByCoordinates(3.1390006, 101.677240, 2016, 12), UnsupportedCoordinatesException.class); }
@Override public Observable<PrayerData> getPrayerTimesByCoordinates(double lat, double lng, int year, int month) { return mApi.getPrayerTimesByCoordinates(lat, lng, year, month) .onErrorResumeNext(mErrorWrapper) .map(new Func1<PrayerResponse, PrayerData>() { @Override public PrayerData call(PrayerResponse r) { return r.getData(); } }); }
RetrofitPrayerClient implements PrayerClient { @Override public Observable<PrayerData> getPrayerTimesByCoordinates(double lat, double lng, int year, int month) { return mApi.getPrayerTimesByCoordinates(lat, lng, year, month) .onErrorResumeNext(mErrorWrapper) .map(new Func1<PrayerResponse, PrayerData>() { @Override public PrayerData call(PrayerResponse r) { return r.getData(); } }); } }
RetrofitPrayerClient implements PrayerClient { @Override public Observable<PrayerData> getPrayerTimesByCoordinates(double lat, double lng, int year, int month) { return mApi.getPrayerTimesByCoordinates(lat, lng, year, month) .onErrorResumeNext(mErrorWrapper) .map(new Func1<PrayerResponse, PrayerData>() { @Override public PrayerData call(PrayerResponse r) { return r.getData(); } }); } RetrofitPrayerClient(OkHttpClient client); }
RetrofitPrayerClient implements PrayerClient { @Override public Observable<PrayerData> getPrayerTimesByCoordinates(double lat, double lng, int year, int month) { return mApi.getPrayerTimesByCoordinates(lat, lng, year, month) .onErrorResumeNext(mErrorWrapper) .map(new Func1<PrayerResponse, PrayerData>() { @Override public PrayerData call(PrayerResponse r) { return r.getData(); } }); } RetrofitPrayerClient(OkHttpClient client); @Override Observable<PrayerData> getPrayerTimesByCode(String code, int year, int month); @Override Observable<PrayerData> getPrayerTimesByCoordinates(double lat, double lng, int year, int month); @Override Observable<List<PrayerCode>> getSupportedCodes(); }
RetrofitPrayerClient implements PrayerClient { @Override public Observable<PrayerData> getPrayerTimesByCoordinates(double lat, double lng, int year, int month) { return mApi.getPrayerTimesByCoordinates(lat, lng, year, month) .onErrorResumeNext(mErrorWrapper) .map(new Func1<PrayerResponse, PrayerData>() { @Override public PrayerData call(PrayerResponse r) { return r.getData(); } }); } RetrofitPrayerClient(OkHttpClient client); @Override Observable<PrayerData> getPrayerTimesByCode(String code, int year, int month); @Override Observable<PrayerData> getPrayerTimesByCoordinates(double lat, double lng, int year, int month); @Override Observable<List<PrayerCode>> getSupportedCodes();  }