MapView extends RelativeLayout { public void getMapAsync(@NonNull OnMapReadyCallback callback) { mapInitializer.init(this, callback); } MapView(Context context);  MapView(Context context, AttributeSet attrs); @NonNull TangramMapView getTangramMapView(); void getMapAsync(@NonNull OnMapReadyCallback callback); void getMapAsync(@NonNull String mapId, @NonNull OnMapReadyCallback callback); void getMapAsync(@NonNull MapStyle mapStyle, @NonNull OnMapReadyCallback callback); void getMapAsync(String mapId, MapStyle mapStyle, @NonNull OnMapReadyCallback callback); void getMapAsync(@NonNull MapStyle mapStyle, @NonNull Locale locale,
      @NonNull OnMapReadyCallback callback); void getMapAsync(MapStyle mapStyle, String mapId, Locale locale,
      @NonNull OnMapReadyCallback callback); @NonNull CompassView getCompass(); @NonNull CompassView showCompass(); void hideCompass(); @NonNull ImageButton getFindMe(); @NonNull ImageButton showFindMe(); void hideFindMe(); @NonNull ImageButton getZoomIn(); @NonNull ImageButton showZoomIn(); void hideZoomIn(); @NonNull ImageButton getZoomOut(); @NonNull ImageButton showZoomOut(); void hideZoomOut(); @NonNull TextView getAttribution(); void onDestroy(); static final int OVERLAY_MODE_SDK; static final int OVERLAY_MODE_CLASSIC; }
@Test public void getMapAsync_shouldInjectMapInitializer() throws Exception { MapzenManager.instance(getMockContext()).setApiKey("fake-mapzen-api-key"); mapView.getMapAsync(new TestCallback()); assertThat(mapView.mapInitializer).isNotNull(); }
@Test public void getMapAsync_shouldInvokeMapInitializer() throws Exception { final MapInitializer mapInitializer = mock(MapInitializer.class); final OnMapReadyCallback callback = new TestCallback(); mapView.mapInitializer = mapInitializer; mapView.getMapAsync(callback); verify(mapInitializer, times(1)).init(mapView, callback); }
@Test public void getMapAsync_shouldUseGivenLocale() throws Exception { final MapInitializer mapInitializer = mock(MapInitializer.class); final OnMapReadyCallback callback = new TestCallback(); final MapStyle mapStyle = new BubbleWrapStyle(); mapView.mapInitializer = mapInitializer; mapView.getMapAsync(mapStyle, Locale.FRENCH, callback); verify(mapInitializer, times(1)).init(mapView, mapStyle, Locale.FRENCH, callback); }