diff options
| author | Aaron Huang <huangaaron@google.com> | 2021-11-27 00:24:27 +0800 |
|---|---|---|
| committer | Aaron Huang <huangaaron@google.com> | 2021-11-27 00:27:33 +0800 |
| commit | ced49fd763e0d9225c31a4b5655f10cc9287a5e4 (patch) | |
| tree | e2443a1aeb0f2fb0b17cb07a9526bc4962da904b /tests/unit/java/com/android/server/IpSecServiceParameterizedTest.java | |
| parent | 1c4a66ddc4f90ad59d517698b8a775bb21210c78 (diff) | |
Change to use Dependencies in IpSecService Tests
The interface IpSecServiceConfiguration is refactored to static
class Dependencies. Refine the tests to use Dependencies.
Bug: 204153604
Test: FrameworksNetTests
Change-Id: Ie2b79b1d948a19f64600ed9ea3b60b192dd92dfd
Diffstat (limited to 'tests/unit/java/com/android/server/IpSecServiceParameterizedTest.java')
| -rw-r--r-- | tests/unit/java/com/android/server/IpSecServiceParameterizedTest.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit/java/com/android/server/IpSecServiceParameterizedTest.java b/tests/unit/java/com/android/server/IpSecServiceParameterizedTest.java index 5bbbe407ec..3ca50f0a6d 100644 --- a/tests/unit/java/com/android/server/IpSecServiceParameterizedTest.java +++ b/tests/unit/java/com/android/server/IpSecServiceParameterizedTest.java @@ -190,7 +190,7 @@ public class IpSecServiceParameterizedTest { INetd mMockNetd; PackageManager mMockPkgMgr; - IpSecService.IpSecServiceConfiguration mMockIpSecSrvConfig; + IpSecService.Dependencies mMockDeps; IpSecService mIpSecService; Network fakeNetwork = new Network(0xAB); int mUid = Os.getuid(); @@ -219,11 +219,11 @@ public class IpSecServiceParameterizedTest { public void setUp() throws Exception { mMockNetd = mock(INetd.class); mMockPkgMgr = mock(PackageManager.class); - mMockIpSecSrvConfig = mock(IpSecService.IpSecServiceConfiguration.class); - mIpSecService = new IpSecService(mTestContext, mMockIpSecSrvConfig); + mMockDeps = mock(IpSecService.Dependencies.class); + mIpSecService = new IpSecService(mTestContext, mMockDeps); // Injecting mock netd - when(mMockIpSecSrvConfig.getNetdInstance()).thenReturn(mMockNetd); + when(mMockDeps.getNetdInstance(mTestContext)).thenReturn(mMockNetd); // PackageManager should always return true (feature flag tests in IpSecServiceTest) when(mMockPkgMgr.hasSystemFeature(anyString())).thenReturn(true); |
