Add afterclass method to remove static field
Some unit tests did not clean their status So add @after method to fix this issue Change-Id: I9450714d1133049a87c2287f527f0598eab56041 Fixes: 73960706 Test: make RunSettingsRoboTests
This commit is contained in:
@@ -38,6 +38,7 @@ import com.android.settingslib.bluetooth.LocalBluetoothManager;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothProfile;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -88,6 +89,11 @@ public class DeviceProfilesSettingsTest {
|
||||
when(mDeviceManager.findDevice(any())).thenReturn(mCachedDevice);
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
ReflectionHelpers.setStaticField(LocalBluetoothManager.class, "sInstance", null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void deviceHasHighQualityAudio() {
|
||||
when(mProfile.supportsHighQualityAudio(any())).thenReturn(true);
|
||||
|
||||
Reference in New Issue
Block a user