DeckItem extends LinearLayout { @OnClick(R.id.deck_card) public void deckClicked() { Intent decksIntent = new Intent(getContext(), TranslationsActivity.class); deckService.setCurrentDeck(deck); dictionaryService.setCurrentDictionary(0); getContext().startActivity(decksIntent); } DeckItem(Context context);  DeckItem(Context context, AttributeSet attrs);  DeckItem(Context context, AttributeSet attrs, int defStyleAttr); void setMenuListener(DeckMenuListener listener); @OnClick(R.id.deck_card) void deckClicked(); void setDeck(Deck deck); @Override void setOnClickListener(OnClickListener listener); static final String DELETE_DECK; static final String SHARE_DECK; }
@Test public void shouldStartTranslationsActivityWhenDeckItemIsClicked() { deckItem.deckClicked(); verify(deckService).setCurrentDeck(deck); verify(dictionaryService).setCurrentDictionary(0); assertEquals(TranslationsActivity.class.getName(), shadowOf((Activity) deckItem.getContext()).getNextStartedActivity().getComponent().getClassName()); }