Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ext {
]

version = [
mapboxMapSdk : '7.0.1',
mapboxMapSdk : '7.1.1',
mapboxJava : '4.3.0',
playLocation : '16.0.0',
autoValue : '1.5.4',
Expand Down
3 changes: 3 additions & 0 deletions plugin-offline/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ dependencies {
annotationProcessor dependenciesList.autoValue
compileOnly dependenciesList.autoValue

// Timber
implementation dependenciesList.timber

// Unit testing
testImplementation dependenciesList.junit
testImplementation dependenciesList.mockito
Expand Down
3 changes: 3 additions & 0 deletions plugin-places/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ dependencies {
implementation dependenciesList.supportV4
implementation dependenciesList.supportDesign

// Timber
implementation dependenciesList.timber

// AutoValues
annotationProcessor dependenciesList.autoValuesParcel
annotationProcessor dependenciesList.autoValue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
package com.mapbox.mapboxsdk.plugins.traffic;

import com.mapbox.mapboxsdk.log.Logger;
import com.mapbox.mapboxsdk.log.LoggerDefinition;
import com.mapbox.mapboxsdk.maps.MapView;
import com.mapbox.mapboxsdk.maps.MapboxMap;
import com.mapbox.mapboxsdk.maps.Style;

import org.junit.Rule;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;

import static junit.framework.TestCase.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class TrafficPluginTest {

Expand All @@ -35,13 +38,14 @@ public void testNonNullAnnotatedArgs() {

@Test
public void testSanity() {
Mockito.when(style.isFullyLoaded()).thenReturn(true);
when(style.isFullyLoaded()).thenReturn(true);
new TrafficPlugin(mapView, mapboxMap, style);
}

@Test
public void testToggle() {
Mockito.when(style.isFullyLoaded()).thenReturn(true);
Logger.setLoggerDefinition(mock(LoggerDefinition.class));
when(style.isFullyLoaded()).thenReturn(true);
TrafficPlugin trafficPlugin = new TrafficPlugin(mapView, mapboxMap, style);
assertFalse(trafficPlugin.isVisible());
trafficPlugin.setVisibility(true);
Expand All @@ -50,7 +54,7 @@ public void testToggle() {

@Test(expected = RuntimeException.class)
public void testNotLoadedStyle() {
Mockito.when(style.isFullyLoaded()).thenReturn(false);
when(style.isFullyLoaded()).thenReturn(false);
new TrafficPlugin(mapView, mapboxMap, style);
}
}