Add mocks for LockPatternUtils.isSecure() method in setup

This change adds mocking for LockPatternUtils.isSecure method in the
tests where SecurityFeatureProvider is referred in setup as per the
comment in b/323649600#comment7
The tests are passing locally even without this.

Bug: 333504640
Test: atest com.android.settings.privatespace
Change-Id: I7d9c3a8356dbf25cf09530ffb53712b3ab887160
This commit is contained in:
josephpv
2024-04-12 11:48:48 +00:00
parent c55cd9526e
commit 5e62407466
3 changed files with 3 additions and 0 deletions

View File

@@ -68,6 +68,7 @@ public class UseOneLockControllerTest {
final FakeFeatureFactory featureFactory = FakeFeatureFactory.setupForTest();
when(featureFactory.securityFeatureProvider.getLockPatternUtils(mContext))
.thenReturn(mLockPatternUtils);
doReturn(true).when(mLockPatternUtils).isSecure(anyInt());
mUseOneLockController = new UseOneLockController(mContext, preferenceKey);
}