BaggersListEntryView extends BaseRecyclerViewHolder<BaggersListEntry> { @Override public void bindData(@NonNull BaggersListEntry data) { super.bindData(data); setTextIfAny(mName, data.name); setTextIfAny(mLinks, data.links); setTextIfAny(mSessions, data.sessions); setTextIfAny(mBio, data.bio); setTextIfAny(mLocations, data.locations); mContactButton.setTag(data.email); if (TextUtils.isEmpty(data.pictureUrl)) { mPicture.setVisibility(View.GONE); } else { mPicasso.load(data.pictureUrl).transform(new RoundedTransformation(4, 0)).noFade().into(mPicture, new Callback() { @Override public void onSuccess() { mPicture.setVisibility(View.VISIBLE); } @Override public void onError() { mPicture.setVisibility(View.GONE); } }); } } BaggersListEntryView(ViewGroup parent); @Override void bindData(@NonNull BaggersListEntry data); @OnClick(R.id.bagger_entry_invite_button) void onInviteButtonClicked(Button button);  }
@Test public void should_bind_data() { Bagger bagger = new Bagger(); bagger.name = "Gautier"; bagger.bio = "Software Craftsman"; bagger.contacts = new Contact(); BaggersListEntry entry = new BaggersListEntry(RuntimeEnvironment.application, bagger); view.bindData(entry); assertThat(view.mName.getText().toString()).isEqualTo("Gautier"); assertThat(view.mBio.getText().toString()).isEqualTo("Software Craftsman"); }