@@ -1,6 +1,5 @@
|
||||
package com.mapbox.mapboxsdk.annotations;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
|
||||
import org.junit.Before;
|
||||
@@ -21,7 +20,6 @@ public class AnnotationTest {
|
||||
@InjectMocks
|
||||
private MapboxMap mapboxMap = mock(MapboxMap.class);
|
||||
private Annotation annotation;
|
||||
@NonNull
|
||||
private Annotation compare = new Annotation() {
|
||||
@Override
|
||||
public long getId() {
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
import com.mapbox.mapboxsdk.R;
|
||||
|
||||
import org.junit.Before;
|
||||
@@ -28,7 +27,6 @@ public class LocationComponentOptionsTest {
|
||||
@Mock
|
||||
private Resources resources;
|
||||
|
||||
@NonNull
|
||||
@Rule
|
||||
public ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mapbox.mapboxsdk.location;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.mapbox.geojson.Feature;
|
||||
import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||
@@ -443,13 +442,13 @@ public class LocationLayerControllerTest {
|
||||
verify(locationFeature, times(0)).addNumberProperty(PROPERTY_ACCURACY_RADIUS, accuracyRadiusValue);
|
||||
}
|
||||
|
||||
private LayerFeatureProvider buildFeatureProvider(@NonNull LocationComponentOptions options) {
|
||||
private LayerFeatureProvider buildFeatureProvider(LocationComponentOptions options) {
|
||||
LayerFeatureProvider provider = mock(LayerFeatureProvider.class);
|
||||
when(provider.generateLocationFeature(null, options)).thenReturn(mock(Feature.class));
|
||||
return provider;
|
||||
}
|
||||
|
||||
private LayerFeatureProvider buildFeatureProvider(Feature feature, @NonNull LocationComponentOptions options) {
|
||||
private LayerFeatureProvider buildFeatureProvider(Feature feature, LocationComponentOptions options) {
|
||||
LayerFeatureProvider provider = mock(LayerFeatureProvider.class);
|
||||
when(provider.generateLocationFeature(null, options)).thenReturn(feature);
|
||||
return provider;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mapbox.mapboxsdk.maps;
|
||||
|
||||
import android.support.annotation.Nullable;
|
||||
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory;
|
||||
import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||
|
||||
@@ -12,7 +11,6 @@ import static org.mockito.Mockito.mock;
|
||||
|
||||
public class MapboxMapTest {
|
||||
|
||||
@Nullable
|
||||
private MapboxMap mapboxMap;
|
||||
|
||||
@Before
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import android.support.annotation.Nullable;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.stubbing.Answer;
|
||||
|
||||
@@ -29,12 +28,10 @@ import static org.mockito.Mockito.when;
|
||||
|
||||
public class MockParcel {
|
||||
|
||||
@Nullable
|
||||
public static Parcelable obtain(@NonNull Parcelable object) {
|
||||
return obtain(object, 0);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Parcelable obtain(@NonNull Parcelable object, int describeContentsValue) {
|
||||
testDescribeContents(object, describeContentsValue);
|
||||
testParcelableArray(object);
|
||||
@@ -169,56 +166,48 @@ public class MockParcel {
|
||||
|
||||
private void setupReads() {
|
||||
when(mockedParcel.readInt()).then(new Answer<Integer>() {
|
||||
@NonNull
|
||||
@Override
|
||||
public Integer answer(InvocationOnMock invocation) throws Throwable {
|
||||
return (Integer) objects.get(position++);
|
||||
}
|
||||
});
|
||||
when(mockedParcel.readByte()).thenAnswer(new Answer<Byte>() {
|
||||
@NonNull
|
||||
@Override
|
||||
public Byte answer(InvocationOnMock invocation) throws Throwable {
|
||||
return (Byte) objects.get(position++);
|
||||
}
|
||||
});
|
||||
when(mockedParcel.readLong()).thenAnswer(new Answer<Long>() {
|
||||
@NonNull
|
||||
@Override
|
||||
public Long answer(InvocationOnMock invocation) throws Throwable {
|
||||
return (Long) objects.get(position++);
|
||||
}
|
||||
});
|
||||
when(mockedParcel.readString()).thenAnswer(new Answer<String>() {
|
||||
@NonNull
|
||||
@Override
|
||||
public String answer(InvocationOnMock invocation) throws Throwable {
|
||||
return (String) objects.get(position++);
|
||||
}
|
||||
});
|
||||
when(mockedParcel.readDouble()).thenAnswer(new Answer<Double>() {
|
||||
@NonNull
|
||||
@Override
|
||||
public Double answer(InvocationOnMock invocation) throws Throwable {
|
||||
return (Double) objects.get(position++);
|
||||
}
|
||||
});
|
||||
when(mockedParcel.readFloat()).thenAnswer(new Answer<Float>() {
|
||||
@NonNull
|
||||
@Override
|
||||
public Float answer(InvocationOnMock invocation) throws Throwable {
|
||||
return (Float) objects.get(position++);
|
||||
}
|
||||
});
|
||||
when(mockedParcel.readParcelable(Parcelable.class.getClassLoader())).thenAnswer(new Answer<Parcelable>() {
|
||||
@NonNull
|
||||
@Override
|
||||
public Parcelable answer(InvocationOnMock invocation) throws Throwable {
|
||||
return (Parcelable) objects.get(position++);
|
||||
}
|
||||
});
|
||||
when(mockedParcel.readParcelableArray(Parcelable.class.getClassLoader())).thenAnswer(new Answer<Object[]>() {
|
||||
@NonNull
|
||||
@Override
|
||||
public Object[] answer(InvocationOnMock invocation) throws Throwable {
|
||||
int size = (Integer) objects.get(position++);
|
||||
@@ -235,7 +224,6 @@ public class MockParcel {
|
||||
}
|
||||
});
|
||||
when(mockedParcel.createIntArray()).then(new Answer<int[]>() {
|
||||
@Nullable
|
||||
@Override
|
||||
public int[] answer(InvocationOnMock invocation) throws Throwable {
|
||||
int size = (Integer) objects.get(position++);
|
||||
@@ -255,9 +243,8 @@ public class MockParcel {
|
||||
|
||||
private void setupOthers() {
|
||||
doAnswer(new Answer<Void>() {
|
||||
@Nullable
|
||||
@Override
|
||||
public Void answer(@NonNull InvocationOnMock invocation) throws Throwable {
|
||||
public Void answer(InvocationOnMock invocation) throws Throwable {
|
||||
position = ((Integer) invocation.getArguments()[0]);
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user