1/* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package com.android.settings.enterprise; 18 19import com.android.settings.testutils.SettingsRobolectricTestRunner; 20import com.android.settings.TestConfig; 21 22import org.junit.runner.RunWith; 23import org.robolectric.annotation.Config; 24 25import static org.mockito.Mockito.when; 26 27/** 28 * Tests for {@link FailedPasswordWipeManagedProfilePreferenceController}. 29 */ 30@RunWith(SettingsRobolectricTestRunner.class) 31@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) 32public final class FailedPasswordWipeManagedProfilePreferenceControllerTest extends 33 FailedPasswordWipePreferenceControllerTestBase { 34 35 private int mMaximumFailedPasswordsBeforeWipe = 0; 36 37 public FailedPasswordWipeManagedProfilePreferenceControllerTest() { 38 super("failed_password_wipe_managed_profile"); 39 } 40 41 @Override 42 public void setUp() { 43 super.setUp(); 44 mController = new FailedPasswordWipeManagedProfilePreferenceController(mContext, 45 null /* lifecycle */); 46 } 47 48 @Override 49 public void setMaximumFailedPasswordsBeforeWipe(int maximum) { 50 when(mFeatureFactory.enterprisePrivacyFeatureProvider 51 .getMaximumFailedPasswordsBeforeWipeInManagedProfile()).thenReturn(maximum); 52 } 53} 54