Fix broken bluetooth robo tests

Bug: 129159331
Test: RunSettingsRoboTests
Change-Id: I3e64659e59fd9b2ac58bf697116e1ee34928a3cd
This commit is contained in:
jackqdyulei
2019-03-25 13:15:30 -07:00
parent b4ae464e99
commit a2208c008b
6 changed files with 19 additions and 12 deletions

View File

@@ -44,6 +44,8 @@ import org.robolectric.annotation.Config;
@Config(shadows = {ShadowBluetoothAdapter.class})
public class SavedBluetoothDeviceUpdaterTest {
private static final String MAC_ADDRESS = "04:52:C7:0B:D8:3C";
@Mock
private DashboardFragment mDashboardFragment;
@Mock
@@ -64,6 +66,7 @@ public class SavedBluetoothDeviceUpdaterTest {
mContext = RuntimeEnvironment.application;
doReturn(mContext).when(mDashboardFragment).getContext();
when(mCachedBluetoothDevice.getDevice()).thenReturn(mBluetoothDevice);
when(mCachedBluetoothDevice.getAddress()).thenReturn(MAC_ADDRESS);
when(mBluetoothDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDED);
mBluetoothDeviceUpdater = spy(new SavedBluetoothDeviceUpdater(mContext, mDashboardFragment,