@Test public void testNullRenderFromKey() { when(mDatafeed.fetchTeam(TEAM_KEY)).thenReturn(Observable.just(null)); TeamListElement element = mRenderer.renderFromKey(TEAM_KEY, ModelType.TEAM, null); assertNull(element); }
@WorkerThread @Override public @Nullable TeamListElement renderFromKey(String key, ModelType type, Integer args) { Team team = mDatafeed.fetchTeam(key).toBlocking().first(); if (team == null) { return null; } return renderFromModel(team, RENDER_BASIC); }
TeamRenderer implements ModelRenderer<Team, Integer> { @WorkerThread @Override public @Nullable TeamListElement renderFromKey(String key, ModelType type, Integer args) { Team team = mDatafeed.fetchTeam(key).toBlocking().first(); if (team == null) { return null; } return renderFromModel(team, RENDER_BASIC); } }
TeamRenderer implements ModelRenderer<Team, Integer> { @WorkerThread @Override public @Nullable TeamListElement renderFromKey(String key, ModelType type, Integer args) { Team team = mDatafeed.fetchTeam(key).toBlocking().first(); if (team == null) { return null; } return renderFromModel(team, RENDER_BASIC); } @Inject  TeamRenderer(APICache datafeed); }
TeamRenderer implements ModelRenderer<Team, Integer> { @WorkerThread @Override public @Nullable TeamListElement renderFromKey(String key, ModelType type, Integer args) { Team team = mDatafeed.fetchTeam(key).toBlocking().first(); if (team == null) { return null; } return renderFromModel(team, RENDER_BASIC); } @Inject  TeamRenderer(APICache datafeed); @WorkerThread @Override @Nullable TeamListElement renderFromKey(String key, ModelType type, Integer args); @WorkerThread @Override @Nullable TeamListElement renderFromModel(Team team, @RenderType Integer renderType); }
TeamRenderer implements ModelRenderer<Team, Integer> { @WorkerThread @Override public @Nullable TeamListElement renderFromKey(String key, ModelType type, Integer args) { Team team = mDatafeed.fetchTeam(key).toBlocking().first(); if (team == null) { return null; } return renderFromModel(team, RENDER_BASIC); } @Inject  TeamRenderer(APICache datafeed); @WorkerThread @Override @Nullable TeamListElement renderFromKey(String key, ModelType type, Integer args); @WorkerThread @Override @Nullable TeamListElement renderFromModel(Team team, @RenderType Integer renderType); static final int RENDER_BASIC; static final int RENDER_DETAILS_BUTTON; static final int RENDER_MYTBA_DETAILS; }