Remove unnecessary mocking in tearDown
The setup for the mocking object will be reset when each test
finishs the test. Reset the mocking value is actually no-op
but cause possible threading issue in Mokito.
Bug: 278979735
Test: atest com.android.server.connectivity.VpnTest \
--rerun-until-failure 100
Change-Id: Ib8c3813e5dbcc9b7432a5548766d63e400b4ed0e
diff --git a/tests/unit/java/com/android/server/connectivity/VpnTest.java b/tests/unit/java/com/android/server/connectivity/VpnTest.java
index c599d9d..2926c9a 100644
--- a/tests/unit/java/com/android/server/connectivity/VpnTest.java
+++ b/tests/unit/java/com/android/server/connectivity/VpnTest.java
@@ -179,7 +179,6 @@
import com.android.testutils.DevSdkIgnoreRule;
import com.android.testutils.DevSdkIgnoreRunner;
-import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -434,11 +433,6 @@
.thenReturn(ikeSession);
}
- @After
- public void tearDown() throws Exception {
- doReturn(PERMISSION_DENIED).when(mContext).checkCallingOrSelfPermission(any());
- }
-
private <T> void mockService(Class<T> clazz, String name, T service) {
doReturn(service).when(mContext).getSystemService(name);
doReturn(name).when(mContext).getSystemServiceName(clazz);