@Test public void requestPopularArticles_returnsObjectWithArticles() throws Exception { final HttpUrl baseUrl = prepareAndStartServerToReturnJsonFromFile(mServer, "popular(ws.blendle.com_items_popular).json"); final ArticlesServer articlesServer = new ArticlesServer(baseUrl, RxJava2CallAdapterFactory. createWithScheduler(Schedulers.trampoline())); final PopularArticlesResource popularArticlesResource = articlesServer.requestPopularArticles(); assertThat("No articles loaded", popularArticlesResource.items().size(), greaterThan(0)); }
@Override public PopularArticlesResource requestPopularArticles() throws IOException { final Retrofit retrofit = new Retrofit.Builder() .baseUrl(mBaseUrl) .addConverterFactory(HALConverterFactory.create(PopularArticlesResource.class)) .build(); final BlendleAPI blendleAPI = retrofit.create(BlendleAPI.class); return blendleAPI.popularArticles().execute().body(); }
ArticlesServer implements ArticlesDataSource { @Override public PopularArticlesResource requestPopularArticles() throws IOException { final Retrofit retrofit = new Retrofit.Builder() .baseUrl(mBaseUrl) .addConverterFactory(HALConverterFactory.create(PopularArticlesResource.class)) .build(); final BlendleAPI blendleAPI = retrofit.create(BlendleAPI.class); return blendleAPI.popularArticles().execute().body(); } }
ArticlesServer implements ArticlesDataSource { @Override public PopularArticlesResource requestPopularArticles() throws IOException { final Retrofit retrofit = new Retrofit.Builder() .baseUrl(mBaseUrl) .addConverterFactory(HALConverterFactory.create(PopularArticlesResource.class)) .build(); final BlendleAPI blendleAPI = retrofit.create(BlendleAPI.class); return blendleAPI.popularArticles().execute().body(); } ArticlesServer();  ArticlesServer(final HttpUrl baseUrl, final CallAdapter.Factory rxAdapter); }
ArticlesServer implements ArticlesDataSource { @Override public PopularArticlesResource requestPopularArticles() throws IOException { final Retrofit retrofit = new Retrofit.Builder() .baseUrl(mBaseUrl) .addConverterFactory(HALConverterFactory.create(PopularArticlesResource.class)) .build(); final BlendleAPI blendleAPI = retrofit.create(BlendleAPI.class); return blendleAPI.popularArticles().execute().body(); } ArticlesServer();  ArticlesServer(final HttpUrl baseUrl, final CallAdapter.Factory rxAdapter); @Override PopularArticlesResource requestPopularArticles(); @Override Single<PopularArticlesResource> requestPopularArticles(@Nullable final Integer amount,
                                                                 @Nullable final Integer page); @Override Single<ArticleResource> requestArticle(@NonNull final String id); }
ArticlesServer implements ArticlesDataSource { @Override public PopularArticlesResource requestPopularArticles() throws IOException { final Retrofit retrofit = new Retrofit.Builder() .baseUrl(mBaseUrl) .addConverterFactory(HALConverterFactory.create(PopularArticlesResource.class)) .build(); final BlendleAPI blendleAPI = retrofit.create(BlendleAPI.class); return blendleAPI.popularArticles().execute().body(); } ArticlesServer();  ArticlesServer(final HttpUrl baseUrl, final CallAdapter.Factory rxAdapter); @Override PopularArticlesResource requestPopularArticles(); @Override Single<PopularArticlesResource> requestPopularArticles(@Nullable final Integer amount,
                                                                 @Nullable final Integer page); @Override Single<ArticleResource> requestArticle(@NonNull final String id);  }