Brad Ebinger | 3eb99bd | 2016-12-20 17:05:27 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 | |
| 17 | package com.android.ims; |
| 18 | |
| 19 | import android.support.test.runner.AndroidJUnit4; |
Brad Ebinger | ed69077 | 2018-01-23 13:41:32 -0800 | [diff] [blame^] | 20 | import android.telephony.ims.aidl.IImsConfig; |
Brad Ebinger | 3eb99bd | 2016-12-20 17:05:27 -0800 | [diff] [blame] | 21 | |
| 22 | import org.junit.After; |
| 23 | import org.junit.Before; |
| 24 | import org.junit.Test; |
| 25 | import org.junit.runner.RunWith; |
| 26 | import org.mockito.Mock; |
| 27 | |
| 28 | import static org.mockito.Matchers.eq; |
| 29 | import static org.mockito.Mockito.verify; |
| 30 | |
| 31 | /** |
| 32 | * Unit Tests for ImsConfig |
| 33 | */ |
| 34 | @RunWith(AndroidJUnit4.class) |
| 35 | public class ImsConfigTest extends ImsTestBase { |
| 36 | |
| 37 | @Mock IImsConfig mMockImsConfigInterface; |
| 38 | |
| 39 | ImsConfig mTestImsConfig; |
| 40 | |
| 41 | @Before |
| 42 | @Override |
| 43 | public void setUp() throws Exception { |
| 44 | super.setUp(); |
| 45 | mTestImsConfig = new ImsConfig(mMockImsConfigInterface, mContext); |
| 46 | } |
| 47 | |
| 48 | @After |
| 49 | @Override |
| 50 | public void tearDown() throws Exception { |
| 51 | mTestImsConfig = null; |
| 52 | super.tearDown(); |
| 53 | } |
| 54 | |
| 55 | @Test |
| 56 | public void testImsConfigGetProvisionedValue() throws Exception { |
| 57 | int testItem = 0; |
| 58 | |
| 59 | mTestImsConfig.getProvisionedValue(testItem); |
| 60 | |
Brad Ebinger | ed69077 | 2018-01-23 13:41:32 -0800 | [diff] [blame^] | 61 | verify(mMockImsConfigInterface).getConfigInt(eq(testItem)); |
Brad Ebinger | 3eb99bd | 2016-12-20 17:05:27 -0800 | [diff] [blame] | 62 | } |
| 63 | } |