Merge SafetyCenterStatusHolder into SafetyCenterManagerWrapper

Test: SettingsUnitTests
Bug: 220384387
Change-Id: I3886d3cf4717b5c7efd99ebd8ffb6a039e3565a4
This commit is contained in:
Marie Matheson
2022-02-18 22:57:17 +00:00
parent 6368af8bdf
commit ce321f0dd0
22 changed files with 88 additions and 139 deletions

View File

@@ -41,26 +41,21 @@ public class BiometricsSafetySourceTest {
@Mock
private SafetyCenterManagerWrapper mSafetyCenterManagerWrapper;
@Mock
private SafetyCenterStatusHolder mSafetyCenterStatusHolder;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mApplicationContext = ApplicationProvider.getApplicationContext();
SafetyCenterManagerWrapper.sInstance = mSafetyCenterManagerWrapper;
SafetyCenterStatusHolder.sInstance = mSafetyCenterStatusHolder;
}
@After
public void tearDown() {
SafetyCenterManagerWrapper.sInstance = null;
SafetyCenterStatusHolder.sInstance = null;
}
@Test
public void sendSafetyData_whenSafetyCenterIsDisabled_sendsNoData() {
when(mSafetyCenterStatusHolder.isEnabled(mApplicationContext)).thenReturn(false);
when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(false);
BiometricsSafetySource.sendSafetyData(mApplicationContext);
@@ -70,7 +65,7 @@ public class BiometricsSafetySourceTest {
@Test
// TODO(b/215517420): Adapt this test when method is implemented.
public void sendSafetyData_whenSafetyCenterIsEnabled_sendsNoData() {
when(mSafetyCenterStatusHolder.isEnabled(mApplicationContext)).thenReturn(true);
when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
BiometricsSafetySource.sendSafetyData(mApplicationContext);