Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de9c7ebc authored by Bhushan Shinkar's avatar Bhushan Shinkar
Browse files

Change when().thenReturn() to doReturn().when() to reduce test flakiness

Change-Id: Ib0210653d687836df1c62c97436a31ce759a043a
Bug: 316564539
Test: atest HeadsetStateMachineTest
Flag: EXEMPT test only change
parent 4b4907b6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -112,8 +112,8 @@ public class HeadsetStateMachineTest {
        MockitoAnnotations.initMocks(this);
        TestUtils.setAdapterService(mAdapterService);
        // Stub system interface
        when(mSystemInterface.getHeadsetPhoneState()).thenReturn(mPhoneState);
        when(mSystemInterface.getAudioManager()).thenReturn(mAudioManager);
        doReturn(mPhoneState).when(mSystemInterface).getHeadsetPhoneState();
        doReturn(mAudioManager).when(mSystemInterface).getAudioManager();
        // This line must be called to make sure relevant objects are initialized properly
        mAdapter = BluetoothAdapter.getDefaultAdapter();
        // Get a device for testing