BitmapMarkerManager { @Deprecated public BitmapMarker addMarker(MarkerOptions markerOptions) { final Marker marker = mapController.addMarker(); BitmapMarker bitmapMarker = bitmapMarkerFactory.createMarker(this, marker, styleStringGenerator); configureMarker(bitmapMarker, markerOptions); Collections.synchronizedList(restorableMarkers).add(bitmapMarker); return bitmapMarker; } BitmapMarkerManager(BitmapMarkerFactory bitmapMarkerFactory,
      StyleStringGenerator styleStringGenerator); void setMapController(MapController mapController); @Deprecated BitmapMarker addMarker(MarkerOptions markerOptions); BitmapMarker addMarker(BitmapMarkerOptions markerOptions); void removeMarker(BitmapMarker marker); void restoreMarkers();  }
@Test public void addMarker_shouldAddMarkerToMapController() throws Exception { bitmapMarkerManager.addMarker(new MarkerOptions()); verify(mapController).addMarker(); }
@Test public void addMarker_shouldSetPosition() throws Exception { LngLat lngLat = new LngLat(); MarkerOptions markerOptions = new MarkerOptions().position(lngLat); BitmapMarker marker = bitmapMarkerManager.addMarker(markerOptions); verify(marker).setPosition(lngLat); }
@Test public void addMarker_resId_shouldSetDrawable() throws Exception { int resId = 123; MarkerOptions markerOptions = new MarkerOptions().icon(resId); BitmapMarker marker = bitmapMarkerManager.addMarker(markerOptions); verify(marker).setIcon(resId); verify(marker, never()).setIcon(any(Drawable.class)); }
@Test public void addMarker_res_shouldSetDrawable() throws Exception { Drawable res = mock(Drawable.class); MarkerOptions markerOptions = new MarkerOptions().icon(res); BitmapMarker marker = bitmapMarkerManager.addMarker(markerOptions); verify(marker).setIcon(res); verify(marker, never()).setIcon(anyInt()); }
@Test public void addMarker_shouldSetSize() throws Exception { MarkerOptions markerOptions = new MarkerOptions().size(100, 100); BitmapMarker marker = bitmapMarkerManager.addMarker(markerOptions); verify(marker).setSize(100, 100); }
@Test public void addMarker_shouldReturnBitmapMarker() throws Exception { assertThat(bitmapMarkerManager.addMarker(new MarkerOptions())).isNotNull(); }
@Test public void addMarker_shouldSetVisibile() throws Exception { MarkerOptions markerOptions = new MarkerOptions().visible(false); BitmapMarker marker = bitmapMarkerManager.addMarker(markerOptions); verify(marker).setVisible(false); }
@Test public void addMarker_shouldSetUserData() throws Exception { Object data = mock(Object.class); MarkerOptions markerOptions = new MarkerOptions().userData(data); BitmapMarker marker = bitmapMarkerManager.addMarker(markerOptions); verify(marker).setUserData(data); }
@Test public void addMarker_shouldSetDrawOrder() throws Exception { MarkerOptions markerOptions = new MarkerOptions().drawOrder(8); BitmapMarker marker = bitmapMarkerManager.addMarker(markerOptions); verify(marker).setDrawOrder(8); }
@Test public void addMarker_shouldSetColorHex() throws Exception { MarkerOptions markerOptions = new MarkerOptions().colorHex("#fff"); BitmapMarker marker = bitmapMarkerManager.addMarker(markerOptions); verify(marker).setColor("#fff"); }
@Test public void addMarker_shouldSetColorInt() throws Exception { MarkerOptions markerOptions = new MarkerOptions().colorInt(Color.RED); BitmapMarker marker = bitmapMarkerManager.addMarker(markerOptions); verify(marker).setColor(Color.RED); }
@Test public void addMarker_shouldSetInteractive() throws Exception { MarkerOptions markerOptions = new MarkerOptions().interactive(false); BitmapMarker marker = bitmapMarkerManager.addMarker(markerOptions); verify(marker).setInteractive(false); }