10
10
import com .mapbox .mapboxsdk .geometry .LatLng ;
11
11
12
12
import org .junit .Test ;
13
+ import org .mockito .ArgumentMatchers ;
13
14
14
15
import java .util .ArrayList ;
15
16
import java .util .List ;
@@ -32,8 +33,9 @@ public void checksAddAMarker() throws Exception {
32
33
Markers markers = new MarkerContainer (aNativeMapView , aMapView , annotationsArray , aIconManager , aMarkerViewManager );
33
34
Polygons polygons = new PolygonContainer (aNativeMapView , annotationsArray );
34
35
Polylines polylines = new PolylineContainer (aNativeMapView , annotationsArray );
36
+ ShapeAnnotations shapeAnnotations = new ShapeAnnotationContainer (aNativeMapView , annotationsArray );
35
37
AnnotationManager annotationManager = new AnnotationManager (aNativeMapView , aMapView , annotationsArray ,
36
- aMarkerViewManager , aIconManager , annotations , markers , polygons , polylines );
38
+ aMarkerViewManager , aIconManager , annotations , markers , polygons , polylines , shapeAnnotations );
37
39
Marker aMarker = mock (Marker .class );
38
40
long aId = 5L ;
39
41
when (aNativeMapView .addMarker (aMarker )).thenReturn (aId );
@@ -58,18 +60,23 @@ public void checksAddMarkers() throws Exception {
58
60
Markers markers = new MarkerContainer (aNativeMapView , aMapView , annotationsArray , aIconManager , aMarkerViewManager );
59
61
Polygons polygons = new PolygonContainer (aNativeMapView , annotationsArray );
60
62
Polylines polylines = new PolylineContainer (aNativeMapView , annotationsArray );
63
+ ShapeAnnotations shapeAnnotations = new ShapeAnnotationContainer (aNativeMapView , annotationsArray );
61
64
AnnotationManager annotationManager = new AnnotationManager (aNativeMapView , aMapView , annotationsArray ,
62
- aMarkerViewManager , aIconManager , annotations , markers , polygons , polylines );
65
+ aMarkerViewManager , aIconManager , annotations , markers , polygons , polylines , shapeAnnotations );
63
66
long firstId = 1L ;
64
67
long secondId = 2L ;
65
68
List <BaseMarkerOptions > markerList = new ArrayList <>();
66
69
MarkerOptions firstMarkerOption = new MarkerOptions ().position (new LatLng ()).title ("first" );
67
70
MarkerOptions secondMarkerOption = new MarkerOptions ().position (new LatLng ()).title ("second" );
71
+
68
72
markerList .add (firstMarkerOption );
69
73
markerList .add (secondMarkerOption );
70
74
MapboxMap aMapboxMap = mock (MapboxMap .class );
71
75
when (aNativeMapView .addMarker (any (Marker .class ))).thenReturn (firstId , secondId );
72
76
77
+ when (aNativeMapView .addMarkers (ArgumentMatchers .<Marker >anyList ()))
78
+ .thenReturn (new long []{firstId , secondId });
79
+
73
80
annotationManager .addMarkers (markerList , aMapboxMap );
74
81
75
82
assertEquals (2 , annotationManager .getAnnotations ().size ());
0 commit comments