@Test public void testRenderFromKey() { when(mDatafeed.fetchMatch(mMatchKey)).thenReturn(Observable.just(mMatch)); MatchListElement element = mRenderer.renderFromKey(mMatchKey, ModelType.MATCH, null); RenderArgs expectedArgs = MatchRenderer.argsFromMode(RENDER_DEFAULT); assertMatch(element, mMatch, expectedArgs); }
@WorkerThread @Override public @Nullable MatchListElement renderFromKey(String key, ModelType type, Integer args) { Match match = mDatafeed.fetchMatch(key).toBlocking().first(); if (match == null) { return null; } return renderFromModel(match, RENDER_DEFAULT); }
MatchRenderer implements ModelRenderer<Match, Integer> { @WorkerThread @Override public @Nullable MatchListElement renderFromKey(String key, ModelType type, Integer args) { Match match = mDatafeed.fetchMatch(key).toBlocking().first(); if (match == null) { return null; } return renderFromModel(match, RENDER_DEFAULT); } }
MatchRenderer implements ModelRenderer<Match, Integer> { @WorkerThread @Override public @Nullable MatchListElement renderFromKey(String key, ModelType type, Integer args) { Match match = mDatafeed.fetchMatch(key).toBlocking().first(); if (match == null) { return null; } return renderFromModel(match, RENDER_DEFAULT); } MatchRenderer(APICache datafeed, Resources resources); }
MatchRenderer implements ModelRenderer<Match, Integer> { @WorkerThread @Override public @Nullable MatchListElement renderFromKey(String key, ModelType type, Integer args) { Match match = mDatafeed.fetchMatch(key).toBlocking().first(); if (match == null) { return null; } return renderFromModel(match, RENDER_DEFAULT); } MatchRenderer(APICache datafeed, Resources resources); @WorkerThread @Override @Nullable MatchListElement renderFromKey(String key, ModelType type, Integer args); @WorkerThread @Override @Nullable MatchListElement renderFromModel(Match match, Integer renderMode); @VisibleForTesting static RenderArgs argsFromMode(@RenderType Integer type); }
MatchRenderer implements ModelRenderer<Match, Integer> { @WorkerThread @Override public @Nullable MatchListElement renderFromKey(String key, ModelType type, Integer args) { Match match = mDatafeed.fetchMatch(key).toBlocking().first(); if (match == null) { return null; } return renderFromModel(match, RENDER_DEFAULT); } MatchRenderer(APICache datafeed, Resources resources); @WorkerThread @Override @Nullable MatchListElement renderFromKey(String key, ModelType type, Integer args); @WorkerThread @Override @Nullable MatchListElement renderFromModel(Match match, Integer renderMode); @VisibleForTesting static RenderArgs argsFromMode(@RenderType Integer type); static final int RENDER_DEFAULT; static final int RENDER_MATCH_INFO; static final int RENDER_NOTIFICATION; }