@Test public void testHandlePositionUpdate() { GuidanceSpeedListener listener = mock(GuidanceSpeedListener.class); mCurrentSpeedPresenter.addListener(listener); when(mPositioningManager.hasValidPosition()).thenReturn(false); mCurrentSpeedPresenter.handlePositionUpdate(); verify(listener).onDataChanged(any()); when(mPositioningManager.hasValidPosition()).thenReturn(true); GeoPosition geoPos = mock(GeoPosition.class); when(geoPos.isValid()).thenReturn(true); when(geoPos.getSpeed()).thenReturn(10.0); when(mPositioningManager.getPosition()).thenReturn(geoPos); mCurrentSpeedPresenter.handlePositionUpdate(); verify(listener, times(2)).onDataChanged(any()); }
@Override protected void handlePositionUpdate() { final RoadElement roadElement = mPositioningManager.getRoadElement(); updateCurrentSpeedData(roadElement == null ? mPreviousSpeedLimit : roadElement.getSpeedLimit()); }
GuidanceSpeedPresenter extends BaseGuidancePresenter { @Override protected void handlePositionUpdate() { final RoadElement roadElement = mPositioningManager.getRoadElement(); updateCurrentSpeedData(roadElement == null ? mPreviousSpeedLimit : roadElement.getSpeedLimit()); } }
GuidanceSpeedPresenter extends BaseGuidancePresenter { @Override protected void handlePositionUpdate() { final RoadElement roadElement = mPositioningManager.getRoadElement(); updateCurrentSpeedData(roadElement == null ? mPreviousSpeedLimit : roadElement.getSpeedLimit()); } GuidanceSpeedPresenter(@NonNull NavigationManager navigationManager,
            @NonNull PositioningManager positioningManager); }
GuidanceSpeedPresenter extends BaseGuidancePresenter { @Override protected void handlePositionUpdate() { final RoadElement roadElement = mPositioningManager.getRoadElement(); updateCurrentSpeedData(roadElement == null ? mPreviousSpeedLimit : roadElement.getSpeedLimit()); } GuidanceSpeedPresenter(@NonNull NavigationManager navigationManager,
            @NonNull PositioningManager positioningManager); @Override void resume(); @Override void pause(); void addListener(GuidanceSpeedListener listener); void removeListener(GuidanceSpeedListener listener); }
GuidanceSpeedPresenter extends BaseGuidancePresenter { @Override protected void handlePositionUpdate() { final RoadElement roadElement = mPositioningManager.getRoadElement(); updateCurrentSpeedData(roadElement == null ? mPreviousSpeedLimit : roadElement.getSpeedLimit()); } GuidanceSpeedPresenter(@NonNull NavigationManager navigationManager,
            @NonNull PositioningManager positioningManager); @Override void resume(); @Override void pause(); void addListener(GuidanceSpeedListener listener); void removeListener(GuidanceSpeedListener listener);  }