LocationsInfoWindowAdapter implements GoogleMap.InfoWindowAdapter { @Override public View getInfoContents(Marker marker) { Location data = getLocationForMarker(marker); setHtmlTextIfNotEmpty(mName, mContext.getString(R.string.location_name, data.name)); setHtmlTextIfNotEmpty(mAddress, data.address); setHtmlTextIfNotEmpty(mContact, mContext.getString(R.string.location_contact, data.contact)); setHtmlTextIfNotEmpty(mAudience, formatAudienceText(data.audience)); setHtmlTextIfNotEmpty(mInterests, formatInterestsText(data.interests)); return mLayout; } LocationsInfoWindowAdapter(Context context, Map<Marker, Location> markerLocations); @Override View getInfoWindow(Marker marker); @Override View getInfoContents(Marker marker); Location getLocationForMarker(@NonNull Marker marker);  }
@Test public void should_bind_data() { location.name = "Xebia"; location.address = "Haussmann"; location.contact = "contact@xebia.fr"; location.audience = new Audience(); location.audience.number = "100"; location.audience.profiles = "Craftsmen"; location.interests = new ArrayList<>(); location.interests.add(new Interest("Agile")); adapter.getInfoContents(marker); assertThat(adapter.mName.getText().toString()).isEqualTo("Xebia"); assertThat(adapter.mAddress.getText().toString()).isEqualTo("Haussmann"); assertThat(adapter.mContact.getText().toString()).contains("contact@xebia.fr"); assertThat(adapter.mAudience.getText().toString()).contains("100"); assertThat(adapter.mAudience.getText().toString()).contains("Craftsmen"); assertThat(adapter.mInterests.getText().toString()).contains("Agile"); }