diff --git a/scripts/telecom_testing.sh b/scripts/telecom_testing.sh
index 723b041..779f449 100644
--- a/scripts/telecom_testing.sh
+++ b/scripts/telecom_testing.sh
@@ -58,7 +58,7 @@
       build_dir="packages/services/Telecomm/tests"
       apk_loc="data/app/TelecomUnitTests/TelecomUnitTests.apk"
       package_prefix="com.android.server.telecom.tests"
-      instrumentation="android.test.InstrumentationTestRunner";;
+      instrumentation="android.support.test.runner.AndroidJUnitRunner";;
     "telephony")
       build_dir="frameworks/opt/telephony/tests/"
       apk_loc="data/app/FrameworksTelephonyTests/FrameworksTelephonyTests.apk"
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
index eccd513..0e79fce 100644
--- a/tests/AndroidManifest.xml
+++ b/tests/AndroidManifest.xml
@@ -51,7 +51,7 @@
         adb shell am instrument -w -e class com.android.server.telecom.tests.unit.FooUnitTest \
                                com.android.server.telecom.tests/android.test.InstrumentationTestRunner
     -->
-    <instrumentation android:name="android.test.InstrumentationTestRunner"
+    <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
             android:targetPackage="com.android.server.telecom.tests"
             android:label="Telecomm application tests"
             android:debuggable="true"/>
diff --git a/tests/src/com/android/server/telecom/tests/AnalyticsTests.java b/tests/src/com/android/server/telecom/tests/AnalyticsTests.java
index c5516c7..9d64f18 100644
--- a/tests/src/com/android/server/telecom/tests/AnalyticsTests.java
+++ b/tests/src/com/android/server/telecom/tests/AnalyticsTests.java
@@ -42,6 +42,12 @@
 import com.android.server.telecom.LogUtils;
 import com.android.server.telecom.nano.TelecomLogClass;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.util.Arrays;
@@ -53,13 +59,32 @@
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyInt;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.mock;
 
+@RunWith(JUnit4.class)
 public class AnalyticsTests extends TelecomSystemTest {
+    @Override
+    @Before
+    public void setUp() throws Exception {
+        super.setUp();
+    }
+
+    @Override
+    @After
+    public void tearDown() throws Exception {
+        super.tearDown();
+    }
+
     @MediumTest
+    @Test
     public void testAnalyticsSingleCall() throws Exception {
         IdPair testCall = startAndMakeActiveIncomingCall(
                 "650-555-1212",
@@ -101,6 +126,7 @@
 
     @FlakyTest
     @MediumTest
+    @Test
     public void testAnalyticsDumping() throws Exception {
         Analytics.reset();
         IdPair testCall = startAndMakeActiveIncomingCall(
@@ -144,6 +170,7 @@
     }
 
     @MediumTest
+    @Test
     public void testAnalyticsTwoCalls() throws Exception {
         IdPair testCall1 = startAndMakeActiveIncomingCall(
                 "650-555-1212",
@@ -196,6 +223,7 @@
     }
 
     @MediumTest
+    @Test
     public void testAnalyticsVideo() throws Exception {
         Analytics.reset();
         IdPair callIds = startAndMakeActiveOutgoingCall(
@@ -245,6 +273,7 @@
     }
 
     @SmallTest
+    @Test
     public void testAnalyticsRounding() {
         long[] testVals = {0, -1, -10, -100, -57836, 1, 10, 100, 1000, 458457};
         long[] expected = {0, -1, -10, -100, -60000, 1, 10, 100, 1000, 500000};
@@ -254,6 +283,7 @@
     }
 
     @SmallTest
+    @Test
     public void testAnalyticsLogSessionTiming() throws Exception {
         long minTime = 50;
         Log.startSession(LogUtils.Sessions.CSW_ADD_CONFERENCE_CALL);
@@ -268,6 +298,7 @@
     }
 
     @MediumTest
+    @Test
     public void testAnalyticsDumpToProto() throws Exception {
         Analytics.reset();
         IdPair testCall = startAndMakeActiveIncomingCall(
@@ -315,6 +346,7 @@
     }
 
     @MediumTest
+    @Test
     public void testAnalyticsAudioRoutes() throws Exception {
         Analytics.reset();
         IdPair testCall = startAndMakeActiveIncomingCall(
@@ -355,6 +387,7 @@
     }
 
     @MediumTest
+    @Test
     public void testAnalyticsConnectionProperties() throws Exception {
         Analytics.reset();
         IdPair testCall = startAndMakeActiveIncomingCall(
@@ -390,6 +423,7 @@
     }
 
     @SmallTest
+    @Test
     public void testAnalyticsMaxSize() throws Exception {
         Analytics.reset();
         for (int i = 0; i < Analytics.MAX_NUM_CALLS_TO_STORE * 2; i++) {
diff --git a/tests/src/com/android/server/telecom/tests/AsyncBlockCheckFilterTest.java b/tests/src/com/android/server/telecom/tests/AsyncBlockCheckFilterTest.java
index 79d711b..66ae17d 100644
--- a/tests/src/com/android/server/telecom/tests/AsyncBlockCheckFilterTest.java
+++ b/tests/src/com/android/server/telecom/tests/AsyncBlockCheckFilterTest.java
@@ -26,6 +26,10 @@
 import com.android.server.telecom.callfiltering.CallFilterResultCallback;
 import com.android.server.telecom.callfiltering.CallFilteringResult;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.Mock;
 
 import java.util.concurrent.CountDownLatch;
@@ -37,6 +41,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class AsyncBlockCheckFilterTest extends TelecomTestCase {
     @Mock private Context mContext;
     @Mock private BlockCheckerAdapter mBlockCheckerAdapter;
@@ -62,6 +67,7 @@
     private static final int TEST_TIMEOUT = 100;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         when(mCall.getHandle()).thenReturn(TEST_HANDLE);
@@ -69,6 +75,7 @@
     }
 
     @SmallTest
+    @Test
     public void testBlockNumber() {
         final CountDownLatch latch = new CountDownLatch(1);
         doAnswer(invocation -> {
@@ -83,6 +90,7 @@
     }
 
     @SmallTest
+    @Test
     public void testDontBlockNumber() {
         final CountDownLatch latch = new CountDownLatch(1);
         doAnswer(invocation -> {
diff --git a/tests/src/com/android/server/telecom/tests/BasicCallTests.java b/tests/src/com/android/server/telecom/tests/BasicCallTests.java
index 41a775f..9db70fd 100644
--- a/tests/src/com/android/server/telecom/tests/BasicCallTests.java
+++ b/tests/src/com/android/server/telecom/tests/BasicCallTests.java
@@ -16,6 +16,10 @@
 
 package com.android.server.telecom.tests;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyInt;
 import static org.mockito.Matchers.anyString;
@@ -56,6 +60,11 @@
 
 import com.google.common.base.Predicate;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
@@ -69,11 +78,25 @@
 /**
  * Performs various basic call tests in Telecom.
  */
+@RunWith(JUnit4.class)
 public class BasicCallTests extends TelecomSystemTest {
     private static final String TEST_BUNDLE_KEY = "android.telecom.extra.TEST";
     private static final String TEST_EVENT = "android.telecom.event.TEST";
 
+    @Override
+    @Before
+    public void setUp() throws Exception {
+        super.setUp();
+    }
+
+    @Override
+    @After
+    public void tearDown() throws Exception {
+        super.tearDown();
+    }
+
     @LargeTest
+    @Test
     public void testSingleOutgoingCallLocalDisconnect() throws Exception {
         IdPair ids = startAndMakeActiveOutgoingCall("650-555-1212",
                 mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA);
@@ -102,6 +125,7 @@
     }
 
     @LargeTest
+    @Test
     public void testSingleOutgoingCallRemoteDisconnect() throws Exception {
         IdPair ids = startAndMakeActiveOutgoingCall("650-555-1212",
                 mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA);
@@ -123,6 +147,7 @@
      * @throws Exception
      */
     @LargeTest
+    @Test
     public void testTelecomManagerAcceptRingingCall() throws Exception {
         IdPair ids = startIncomingPhoneCall("650-555-1212", mPhoneAccountA0.getAccountHandle(),
                 mConnectionServiceFixtureA);
@@ -149,6 +174,7 @@
      * @throws Exception
      */
     @LargeTest
+    @Test
     public void testTelecomManagerAcceptRingingVideoCall() throws Exception {
         IdPair ids = startIncomingPhoneCall("650-555-1212", mPhoneAccountA0.getAccountHandle(),
                 VideoProfile.STATE_BIDIRECTIONAL, mConnectionServiceFixtureA);
@@ -177,6 +203,7 @@
      * @throws Exception
      */
     @LargeTest
+    @Test
     public void testTelecomManagerAcceptRingingVideoCallAsAudio() throws Exception {
         IdPair ids = startIncomingPhoneCall("650-555-1212", mPhoneAccountA0.getAccountHandle(),
                 VideoProfile.STATE_BIDIRECTIONAL, mConnectionServiceFixtureA);
@@ -204,6 +231,7 @@
      * @throws Exception
      */
     @LargeTest
+    @Test
     public void testTelecomManagerAcceptRingingInvalidVideoState() throws Exception {
         IdPair ids = startIncomingPhoneCall("650-555-1212", mPhoneAccountA0.getAccountHandle(),
                 VideoProfile.STATE_BIDIRECTIONAL, mConnectionServiceFixtureA);
@@ -225,6 +253,7 @@
     }
 
     @LargeTest
+    @Test
     public void testSingleIncomingCallLocalDisconnect() throws Exception {
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
                 mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA);
@@ -242,6 +271,7 @@
     }
 
     @LargeTest
+    @Test
     public void testSingleIncomingCallRemoteDisconnect() throws Exception {
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
                 mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA);
@@ -256,6 +286,7 @@
     }
 
     @LargeTest
+    @Test
     public void testIncomingEmergencyCallback() throws Exception {
         // Make an outgoing emergency call
         String phoneNumber = "650-555-1212";
@@ -279,15 +310,16 @@
                 .createConnection(any(PhoneAccountHandle.class), anyString(),
                         connectionRequestCaptor.capture(), eq(true), eq(false), any());
 
-        assert(connectionRequestCaptor.getValue().getExtras().containsKey(
+        assertTrue(connectionRequestCaptor.getValue().getExtras().containsKey(
             android.telecom.Call.EXTRA_LAST_EMERGENCY_CALLBACK_TIME_MILLIS));
         assertTrue(connectionRequestCaptor.getValue().getExtras().getLong(
             android.telecom.Call.EXTRA_LAST_EMERGENCY_CALLBACK_TIME_MILLIS, 0) > 0);
-        assert(connectionRequestCaptor.getValue().getExtras().containsKey(
+        assertTrue(connectionRequestCaptor.getValue().getExtras().containsKey(
             TelecomManager.EXTRA_INCOMING_CALL_ADDRESS));
     }
 
     @LargeTest
+    @Test
     public void testOutgoingCallAndSelectPhoneAccount() throws Exception {
         // Remove default PhoneAccount so that the Call moves into the correct
         // SELECT_PHONE_ACCOUNT state.
@@ -317,6 +349,7 @@
     }
 
     @LargeTest
+    @Test
     public void testIncomingCallFromContactWithSendToVoicemailIsRejected() throws Exception {
         Bundle extras = new Bundle();
         extras.putParcelable(
@@ -359,6 +392,7 @@
     }
 
     @LargeTest
+    @Test
     public void testIncomingCallCallerInfoLookupTimesOutIsAllowed() throws Exception {
         when(mClockProxy.currentTimeMillis()).thenReturn(TEST_CREATE_TIME);
         when(mClockProxy.elapsedRealtime()).thenReturn(TEST_CREATE_ELAPSED_TIME);
@@ -405,6 +439,7 @@
     }
 
     @LargeTest
+    @Test
     public void testIncomingCallFromBlockedNumberIsRejected() throws Exception {
         String phoneNumber = "650-555-1212";
         blockNumber(phoneNumber);
@@ -443,6 +478,7 @@
     }
 
     @LargeTest
+    @Test
     public void testIncomingCallBlockCheckTimesoutIsAllowed() throws Exception {
         final CountDownLatch latch = new CountDownLatch(1);
         String phoneNumber = "650-555-1212";
@@ -490,20 +526,8 @@
                 });
     }
 
-    @MediumTest
-    public void testDeadlockOnOutgoingCall() throws Exception {
-        for (int i = 0; i < 100; i++) {
-            BasicCallTests test = new BasicCallTests();
-            test.setContext(getContext());
-            test.setTestContext(getTestContext());
-            test.setName(getName());
-            test.setUp();
-            test.do_testDeadlockOnOutgoingCall();
-            test.tearDown();
-        }
-    }
-
     @LargeTest
+    @Test
     public void testIncomingThenOutgoingCalls() throws Exception {
         // TODO: We have to use the same PhoneAccount for both; see http://b/18461539
         IdPair incoming = startAndMakeActiveIncomingCall("650-555-2323",
@@ -516,6 +540,7 @@
     }
 
     @LargeTest
+    @Test
     public void testOutgoingThenIncomingCalls() throws Exception {
         // TODO: We have to use the same PhoneAccount for both; see http://b/18461539
         IdPair outgoing = startAndMakeActiveOutgoingCall("650-555-1212",
@@ -537,6 +562,7 @@
     }
 
     @LargeTest
+    @Test
     public void testAudioManagerOperations() throws Exception {
         AudioManager audioManager = (AudioManager) mComponentContextFixture.getTestDouble()
                 .getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
@@ -598,11 +624,13 @@
     }
 
     @MediumTest
+    @Test
     public void testBasicConferenceCall() throws Exception {
         makeConferenceCall();
     }
 
     @MediumTest
+    @Test
     public void testAddCallToConference1() throws Exception {
         ParcelableCall conferenceCall = makeConferenceCall();
         IdPair callId3 = startAndMakeActiveOutgoingCall("650-555-1214",
@@ -620,6 +648,7 @@
     }
 
     @MediumTest
+    @Test
     public void testAddCallToConference2() throws Exception {
         ParcelableCall conferenceCall = makeConferenceCall();
         IdPair callId3 = startAndMakeActiveOutgoingCall("650-555-1214",
@@ -642,6 +671,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testPullNonExternalCall() throws Exception {
         // TODO: Revisit this unit test once telecom support for filtering external calls from
         // InCall services is implemented.
@@ -662,6 +692,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testSendConnectionEventNull() throws Exception {
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
                 mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA);
@@ -677,6 +708,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testSendConnectionEventNotNull() throws Exception {
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
                 mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA);
@@ -698,6 +730,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testSendCallEventNull() throws Exception {
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
                 mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA);
@@ -714,6 +747,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testSendCallEventNonNull() throws Exception {
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
                 mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA);
@@ -776,6 +810,7 @@
      * property set.
      */
     @MediumTest
+    @Test
     public void testCdmaEnhancedPrivacyVoiceCall() throws Exception {
         mConnectionServiceFixtureA.mConnectionServiceDelegate.mProperties =
                 Connection.PROPERTY_HAS_CDMA_VOICE_PRIVACY;
@@ -794,6 +829,7 @@
      * when the Connection.PROPERTY_HAS_CDMA_VOICE_PRIVACY property is removed from the Connection.
      */
     @MediumTest
+    @Test
     public void testDropCdmaEnhancedPrivacyVoiceCall() throws Exception {
         mConnectionServiceFixtureA.mConnectionServiceDelegate.mProperties =
                 Connection.PROPERTY_HAS_CDMA_VOICE_PRIVACY;
@@ -815,6 +851,7 @@
      * @throws Exception
      */
     @LargeTest
+    @Test
     public void testPullExternalCall() throws Exception {
         // TODO: Revisit this unit test once telecom support for filtering external calls from
         // InCall services is implemented.
@@ -841,6 +878,7 @@
      * @throws Exception
      */
     @LargeTest
+    @Test
     public void testPullNonPullableExternalCall() throws Exception {
         // TODO: Revisit this unit test once telecom support for filtering external calls from
         // InCall services is implemented.
@@ -864,6 +902,7 @@
      * @throws Exception
      */
     @LargeTest
+    @Test
     public void testOutgoingCallSelectPhoneAccountVideo() throws Exception {
         startOutgoingPhoneCallPendingCreateConnection("650-555-1212",
                 null, mConnectionServiceFixtureA,
@@ -886,6 +925,7 @@
      */
     @FlakyTest
     @LargeTest
+    @Test
     public void testOutgoingCallSelectPhoneAccountNoVideo() throws Exception {
         startOutgoingPhoneCallPendingCreateConnection("650-555-1212",
                 null, mConnectionServiceFixtureA,
@@ -906,6 +946,7 @@
      * @throws Exception
      */
     @LargeTest
+    @Test
     public void testSelfManagedOutgoing() throws Exception {
         PhoneAccountHandle phoneAccountHandle = mPhoneAccountSelfManaged.getAccountHandle();
         IdPair ids = startAndMakeActiveOutgoingCall("650-555-1212", phoneAccountHandle,
@@ -920,6 +961,7 @@
      * @throws Exception
      */
     @LargeTest
+    @Test
     public void testSelfManagedIncoming() throws Exception {
         PhoneAccountHandle phoneAccountHandle = mPhoneAccountSelfManaged.getAccountHandle();
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212", phoneAccountHandle,
@@ -935,6 +977,7 @@
      * @throws Exception
      */
     @LargeTest
+    @Test
     public void testIsOutgoingCallPermitted() throws Exception {
         assertTrue(mTelecomSystem.getTelecomServiceImpl().getBinder()
                 .isOutgoingCallPermitted(mPhoneAccountSelfManaged.getAccountHandle()));
@@ -946,6 +989,7 @@
      * @throws Exception
      */
     @LargeTest
+    @Test
     public void testIsOutgoingCallPermittedOngoing() throws Exception {
         // Start a regular call; the self-managed CS can't make a call now.
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
@@ -962,6 +1006,7 @@
      * @throws Exception
      */
     @LargeTest
+    @Test
     public void testDisconnectSelfManaged() throws Exception {
         // Add a self-managed call.
         PhoneAccountHandle phoneAccountHandle = mPhoneAccountSelfManaged.getAccountHandle();
diff --git a/tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java b/tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java
index 05f3dd6..59934dc 100644
--- a/tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java
@@ -31,12 +31,20 @@
 import com.android.server.telecom.bluetooth.BluetoothDeviceManager;
 import com.android.server.telecom.bluetooth.BluetoothRouteManager;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.verify;
 
+@RunWith(JUnit4.class)
 public class BluetoothDeviceManagerTest extends TelecomTestCase {
     @Mock BluetoothRouteManager mRouteManager;
     @Mock BluetoothHeadsetProxy mHeadsetProxy;
@@ -50,6 +58,8 @@
     private BluetoothDevice device2;
     private BluetoothDevice device3;
 
+    @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         device1 = makeBluetoothDevice("00:00:00:00:00:01");
@@ -80,6 +90,7 @@
     }
 
     @SmallTest
+    @Test
     public void testSingleDeviceConnectAndDisconnect() {
         receiverUnderTest.onReceive(mContext,
                 buildConnectionActionIntent(BluetoothHeadset.STATE_CONNECTED, device1));
@@ -93,6 +104,7 @@
     }
 
     @SmallTest
+    @Test
     public void testMultiDeviceConnectAndDisconnect() {
         receiverUnderTest.onReceive(mContext,
                 buildConnectionActionIntent(BluetoothHeadset.STATE_CONNECTED, device1));
@@ -115,6 +127,7 @@
     }
 
     @SmallTest
+    @Test
     public void testExclusionaryGetRecentDevices() {
         receiverUnderTest.onReceive(mContext,
                 buildConnectionActionIntent(BluetoothHeadset.STATE_CONNECTED, device1));
@@ -132,6 +145,7 @@
     }
 
     @SmallTest
+    @Test
     public void testHeadsetServiceDisconnect() {
         receiverUnderTest.onReceive(mContext,
                 buildConnectionActionIntent(BluetoothHeadset.STATE_CONNECTED, device1));
diff --git a/tests/src/com/android/server/telecom/tests/BluetoothPhoneServiceTest.java b/tests/src/com/android/server/telecom/tests/BluetoothPhoneServiceTest.java
index 885fbc4..a5feab7 100644
--- a/tests/src/com/android/server/telecom/tests/BluetoothPhoneServiceTest.java
+++ b/tests/src/com/android/server/telecom/tests/BluetoothPhoneServiceTest.java
@@ -22,12 +22,10 @@
 import android.graphics.drawable.Icon;
 import android.net.Uri;
 import android.os.Binder;
-import android.os.Debug;
 import android.telecom.Connection;
 import android.telecom.GatewayInfo;
 import android.telecom.PhoneAccount;
 import android.telecom.PhoneAccountHandle;
-import android.telecom.TelecomManager;
 import android.telephony.PhoneNumberUtils;
 import android.telephony.TelephonyManager;
 import android.test.suitebuilder.annotation.MediumTest;
@@ -42,12 +40,18 @@
 import com.android.server.telecom.PhoneAccountRegistrar;
 import com.android.server.telecom.TelecomSystem;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 
 import java.util.ArrayList;
 import java.util.LinkedList;
 
+import static org.junit.Assert.assertEquals;
 import static org.mockito.ArgumentMatchers.nullable;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyBoolean;
@@ -64,6 +68,7 @@
 import static org.mockito.Mockito.when;
 import static org.mockito.Mockito.verify;
 
+@RunWith(JUnit4.class)
 public class BluetoothPhoneServiceTest extends TelecomTestCase {
 
     private static final int TEST_DTMF_TONE = 0;
@@ -97,6 +102,7 @@
     @Mock BluetoothHeadsetProxy mMockBluetoothHeadset;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         MockitoAnnotations.initMocks(this);
@@ -120,6 +126,7 @@
     }
 
     @Override
+    @After
     public void tearDown() throws Exception {
 
         mBluetoothPhoneService = null;
@@ -127,6 +134,7 @@
     }
 
     @SmallTest
+    @Test
     public void testHeadsetAnswerCall() throws Exception {
         Call mockCall = createRingingCall();
 
@@ -137,6 +145,7 @@
     }
 
     @SmallTest
+    @Test
     public void testHeadsetAnswerCallNull() throws Exception {
         when(mMockCallsManager.getRingingCall()).thenReturn(null);
 
@@ -147,6 +156,7 @@
     }
 
     @SmallTest
+    @Test
     public void testHeadsetHangupCall() throws Exception {
         Call mockCall = createForegroundCall();
 
@@ -157,6 +167,7 @@
     }
 
     @SmallTest
+    @Test
     public void testHeadsetHangupCallNull() throws Exception {
         when(mMockCallsManager.getForegroundCall()).thenReturn(null);
 
@@ -167,6 +178,7 @@
     }
 
     @SmallTest
+    @Test
     public void testHeadsetSendDTMF() throws Exception {
         Call mockCall = createForegroundCall();
 
@@ -178,6 +190,7 @@
     }
 
     @SmallTest
+    @Test
     public void testHeadsetSendDTMFNull() throws Exception {
         when(mMockCallsManager.getForegroundCall()).thenReturn(null);
 
@@ -189,6 +202,7 @@
     }
 
     @SmallTest
+    @Test
     public void testGetNetworkOperator() throws Exception {
         Call mockCall = createForegroundCall();
         PhoneAccount fakePhoneAccount = makeQuickAccount("id0", TEST_ACCOUNT_INDEX);
@@ -201,6 +215,7 @@
     }
 
     @SmallTest
+    @Test
     public void testGetNetworkOperatorNoPhoneAccount() throws Exception {
         when(mMockCallsManager.getForegroundCall()).thenReturn(null);
 
@@ -210,6 +225,7 @@
     }
 
     @SmallTest
+    @Test
     public void testGetSubscriberNumber() throws Exception {
         Call mockCall = createForegroundCall();
         PhoneAccount fakePhoneAccount = makeQuickAccount("id0", TEST_ACCOUNT_INDEX);
@@ -222,6 +238,7 @@
     }
 
     @SmallTest
+    @Test
     public void testGetSubscriberNumberFallbackToTelephony() throws Exception {
         Call mockCall = createForegroundCall();
         String fakeNumber = "8675309";
@@ -237,6 +254,7 @@
     }
 
     @MediumTest
+    @Test
     public void testListCurrentCallsOneCall() throws Exception {
         ArrayList<Call> calls = new ArrayList<>();
         Call activeCall = createActiveCall();
@@ -254,6 +272,7 @@
     }
 
     @MediumTest
+    @Test
     public void testConferenceInProgressCDMA() throws Exception {
         // If two calls are being conferenced and updateHeadsetWithCallState runs while this is
         // still occuring, it will look like there is an active and held call still while we are
@@ -304,6 +323,7 @@
     }
 
     @MediumTest
+    @Test
     public void testListCurrentCallsCdmaHold() throws Exception {
         // Call has been put into a CDMA "conference" with one call on hold.
         ArrayList<Call> calls = new ArrayList<>();
@@ -345,6 +365,7 @@
     }
 
     @MediumTest
+    @Test
     public void testListCurrentCallsCdmaConference() throws Exception {
         // Call is in a true CDMA conference
         ArrayList<Call> calls = new ArrayList<>();
@@ -386,6 +407,7 @@
     }
 
     @MediumTest
+    @Test
     public void testWaitingCallClccResponse() throws Exception {
         ArrayList<Call> calls = new ArrayList<>();
         when(mMockCallsManager.getCalls()).thenReturn(calls);
@@ -408,6 +430,7 @@
     }
 
     @MediumTest
+    @Test
     public void testNewCallClccResponse() throws Exception {
         ArrayList<Call> calls = new ArrayList<>();
         when(mMockCallsManager.getCalls()).thenReturn(calls);
@@ -423,6 +446,7 @@
     }
 
     @MediumTest
+    @Test
     public void testRingingCallClccResponse() throws Exception {
         ArrayList<Call> calls = new ArrayList<>();
         when(mMockCallsManager.getCalls()).thenReturn(calls);
@@ -443,6 +467,7 @@
     }
 
     @MediumTest
+    @Test
     public void testCallClccCache() throws Exception {
         ArrayList<Call> calls = new ArrayList<>();
         when(mMockCallsManager.getCalls()).thenReturn(calls);
@@ -477,6 +502,7 @@
     }
 
     @MediumTest
+    @Test
     public void testAlertingCallClccResponse() throws Exception {
         ArrayList<Call> calls = new ArrayList<>();
         when(mMockCallsManager.getCalls()).thenReturn(calls);
@@ -497,6 +523,7 @@
     }
 
     @MediumTest
+    @Test
     public void testHoldingCallClccResponse() throws Exception {
         ArrayList<Call> calls = new ArrayList<>();
         when(mMockCallsManager.getCalls()).thenReturn(calls);
@@ -526,6 +553,7 @@
     }
 
     @MediumTest
+    @Test
     public void testListCurrentCallsImsConference() throws Exception {
         ArrayList<Call> calls = new ArrayList<>();
         Call parentCall = createActiveCall();
@@ -544,6 +572,7 @@
     }
 
     @MediumTest
+    @Test
     public void testListCurrentCallsHeldImsCepConference() throws Exception {
         ArrayList<Call> calls = new ArrayList<>();
         Call parentCall = createHeldCall();
@@ -574,6 +603,7 @@
     }
 
     @MediumTest
+    @Test
     public void testQueryPhoneState() throws Exception {
         Call ringingCall = createRingingCall();
         when(ringingCall.getHandle()).thenReturn(Uri.parse("tel:5550000"));
@@ -585,6 +615,7 @@
     }
 
     @MediumTest
+    @Test
     public void testCDMAConferenceQueryState() throws Exception {
         Call parentConfCall = createActiveCall();
         final Call confCall1 = mock(Call.class);
@@ -605,6 +636,7 @@
     }
 
     @MediumTest
+    @Test
     public void testProcessChldTypeReleaseHeldRinging() throws Exception {
         Call ringingCall = createRingingCall();
 
@@ -615,6 +647,7 @@
     }
 
     @MediumTest
+    @Test
     public void testProcessChldTypeReleaseHeldHold() throws Exception {
         Call onHoldCall = createHeldCall();
 
@@ -625,6 +658,7 @@
     }
 
     @MediumTest
+    @Test
     public void testProcessChldReleaseActiveRinging() throws Exception {
         Call activeCall = createActiveCall();
         Call ringingCall = createRingingCall();
@@ -638,6 +672,7 @@
     }
 
     @MediumTest
+    @Test
     public void testProcessChldReleaseActiveHold() throws Exception {
         Call activeCall = createActiveCall();
         Call heldCall = createHeldCall();
@@ -651,6 +686,7 @@
     }
 
     @MediumTest
+    @Test
     public void testProcessChldHoldActiveRinging() throws Exception {
         Call ringingCall = createRingingCall();
 
@@ -662,6 +698,7 @@
     }
 
     @MediumTest
+    @Test
     public void testProcessChldHoldActiveUnhold() throws Exception {
         Call heldCall = createHeldCall();
 
@@ -673,6 +710,7 @@
     }
 
     @MediumTest
+    @Test
     public void testProcessChldHoldActiveHold() throws Exception {
         Call activeCall = createActiveCall();
         addCallCapability(activeCall, Connection.CAPABILITY_HOLD);
@@ -685,6 +723,7 @@
     }
 
     @MediumTest
+    @Test
     public void testProcessChldAddHeldToConfHolding() throws Exception {
         Call activeCall = createActiveCall();
         addCallCapability(activeCall, Connection.CAPABILITY_MERGE_CONFERENCE);
@@ -696,6 +735,7 @@
     }
 
     @MediumTest
+    @Test
     public void testProcessChldAddHeldToConf() throws Exception {
         Call activeCall = createActiveCall();
         removeCallCapability(activeCall, Connection.CAPABILITY_MERGE_CONFERENCE);
@@ -711,6 +751,7 @@
     }
 
     @MediumTest
+    @Test
     public void testProcessChldHoldActiveSwapConference() throws Exception {
         // Create an active CDMA Call with a call on hold and simulate a swapConference().
         Call parentCall = createActiveCall();
@@ -736,6 +777,7 @@
 
     // Testing the CallsManager Listener Functionality on Bluetooth
     @MediumTest
+    @Test
     public void testOnCallAddedRinging() throws Exception {
         Call ringingCall = createRingingCall();
         when(ringingCall.getHandle()).thenReturn(Uri.parse("tel:555000"));
@@ -748,6 +790,7 @@
     }
 
     @MediumTest
+    @Test
     public void testOnCallAddedCdmaActiveHold() throws Exception {
         // Call has been put into a CDMA "conference" with one call on hold.
         Call parentCall = createActiveCall();
@@ -769,6 +812,7 @@
     }
 
     @MediumTest
+    @Test
     public void testOnCallRemoved() throws Exception {
         Call activeCall = createActiveCall();
         mBluetoothPhoneService.mCallsManagerListener.onCallAdded(activeCall);
@@ -780,6 +824,7 @@
     }
 
     @MediumTest
+    @Test
     public void testOnCallStateChangedConnectingCall() throws Exception {
         Call activeCall = mock(Call.class);
         Call connectingCall = mock(Call.class);
@@ -797,6 +842,7 @@
     }
 
     @MediumTest
+    @Test
     public void testOnCallStateChangedDialing() throws Exception {
         Call activeCall = createActiveCall();
 
@@ -808,6 +854,7 @@
     }
 
     @MediumTest
+    @Test
     public void testOnCallStateChangedAlerting() throws Exception {
         Call outgoingCall = createOutgoingCall();
 
@@ -819,6 +866,7 @@
     }
 
     @MediumTest
+    @Test
     public void testOnCallStateChangedDisconnected() throws Exception {
         Call disconnectedCall = createDisconnectedCall();
         doReturn(true).when(mMockCallsManager).hasOnlyDisconnectedCalls();
@@ -838,6 +886,7 @@
     }
 
     @MediumTest
+    @Test
     public void testOnCallStateChanged() throws Exception {
         Call ringingCall = createRingingCall();
         when(ringingCall.getHandle()).thenReturn(Uri.parse("tel:555-0000"));
@@ -858,6 +907,7 @@
     }
 
     @MediumTest
+    @Test
     public void testOnCallStateChangedGSMSwap() throws Exception {
         Call heldCall = createHeldCall();
         when(heldCall.getHandle()).thenReturn(Uri.parse("tel:555-0000"));
@@ -870,6 +920,7 @@
     }
 
     @MediumTest
+    @Test
     public void testOnIsConferencedChanged() throws Exception {
         // Start with two calls that are being merged into a CDMA conference call. The
         // onIsConferencedChanged method will be called multiple times during the call. Make sure
@@ -906,6 +957,7 @@
     }
 
     @MediumTest
+    @Test
     public void testBluetoothAdapterReceiver() throws Exception {
         Call ringingCall = createRingingCall();
         when(ringingCall.getHandle()).thenReturn(Uri.parse("tel:5550000"));
diff --git a/tests/src/com/android/server/telecom/tests/BluetoothRouteManagerTest.java b/tests/src/com/android/server/telecom/tests/BluetoothRouteManagerTest.java
index 2b2caaf..247d698 100644
--- a/tests/src/com/android/server/telecom/tests/BluetoothRouteManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/BluetoothRouteManagerTest.java
@@ -31,6 +31,10 @@
 import com.android.server.telecom.bluetooth.BluetoothDeviceManager;
 import com.android.server.telecom.bluetooth.BluetoothRouteManager;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.Mock;
 
 import java.util.ArrayList;
@@ -38,6 +42,7 @@
 import java.util.List;
 import java.util.Objects;
 
+import static org.junit.Assert.assertEquals;
 import static org.mockito.ArgumentMatchers.nullable;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doAnswer;
@@ -48,6 +53,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class BluetoothRouteManagerTest extends StateMachineTestBase<BluetoothRouteManager> {
     private enum ListenerUpdate {
         DEVICE_LIST_CHANGED, DEVICE_AVAILABLE, DEVICE_UNAVAILABLE,
@@ -207,6 +213,7 @@
     private BluetoothDevice device3;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         mContext = mComponentContextFixture.getTestDouble().getApplicationContext();
@@ -217,12 +224,14 @@
     }
 
     @LargeTest
+    @Test
     public void testTransitions() throws Throwable {
         List<BluetoothRouteTestParameters> testCases = generateTestCases();
         parametrizedTestStateMachine(testCases);
     }
 
     @SmallTest
+    @Test
     public void testConnectHfpRetryWhileNotConnected() {
         BluetoothRouteManager sm = setupStateMachine(
                 BluetoothRouteManager.AUDIO_OFF_STATE_NAME, null);
@@ -244,6 +253,7 @@
     }
 
     @SmallTest
+    @Test
     public void testConnectHfpRetryWhileConnectedToAnotherDevice() {
         BluetoothRouteManager sm = setupStateMachine(
                 BluetoothRouteManager.AUDIO_CONNECTED_STATE_NAME_PREFIX, device1);
@@ -268,6 +278,7 @@
     }
 
     @SmallTest
+    @Test
     public void testProperFallbackOrder1() {
         // Device 1, 2, 3 are connected in that order. Device 1 is activated, then device 2.
         // Disconnect device 2, verify fallback to device 1. Disconnect device 1, fallback to
@@ -319,6 +330,7 @@
     }
 
     @SmallTest
+    @Test
     public void testProperFallbackOrder2() {
         // Device 1, 2, 3 are connected in that order. Device 3 is activated.
         // Disconnect device 3, verify fallback to device 2. Disconnect device 2, fallback to
diff --git a/tests/src/com/android/server/telecom/tests/CallAudioManagerTest.java b/tests/src/com/android/server/telecom/tests/CallAudioManagerTest.java
index 488ac29..78f7b50 100644
--- a/tests/src/com/android/server/telecom/tests/CallAudioManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/CallAudioManagerTest.java
@@ -32,6 +32,10 @@
 import com.android.server.telecom.RingbackPlayer;
 import com.android.server.telecom.Ringer;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 
@@ -39,6 +43,8 @@
 import java.util.List;
 import java.util.stream.Collectors;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyInt;
 import static org.mockito.Matchers.eq;
@@ -49,6 +55,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class CallAudioManagerTest extends TelecomTestCase {
     @Mock private CallAudioRouteStateMachine mCallAudioRouteStateMachine;
     @Mock private CallsManager mCallsManager;
@@ -61,6 +68,7 @@
     private CallAudioManager mCallAudioManager;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         doAnswer((invocation) -> {
@@ -82,6 +90,7 @@
     }
 
     @MediumTest
+    @Test
     public void testUnmuteOfSecondIncomingCall() {
         // Start with a single incoming call.
         Call call = createIncomingCall();
@@ -145,6 +154,7 @@
     }
 
     @MediumTest
+    @Test
     public void testSingleIncomingCallFlowWithoutMTSpeedUp() {
         Call call = createIncomingCall();
         when(call.can(android.telecom.Call.Details.CAPABILITY_SPEED_UP_MT_AUDIO))
@@ -180,6 +190,7 @@
     }
 
     @MediumTest
+    @Test
     public void testSingleIncomingCallFlowWithMTSpeedUp() {
         Call call = createIncomingCall();
         when(call.can(android.telecom.Call.Details.CAPABILITY_SPEED_UP_MT_AUDIO))
@@ -213,6 +224,7 @@
     }
 
     @MediumTest
+    @Test
     public void testSingleOutgoingCall() {
         Call call = mock(Call.class);
         when(call.getState()).thenReturn(CallState.CONNECTING);
diff --git a/tests/src/com/android/server/telecom/tests/CallAudioModeStateMachineTest.java b/tests/src/com/android/server/telecom/tests/CallAudioModeStateMachineTest.java
index af1d3a2..c50ea60 100644
--- a/tests/src/com/android/server/telecom/tests/CallAudioModeStateMachineTest.java
+++ b/tests/src/com/android/server/telecom/tests/CallAudioModeStateMachineTest.java
@@ -23,11 +23,16 @@
 import com.android.server.telecom.CallAudioManager;
 import com.android.server.telecom.CallAudioModeStateMachine;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.Mock;
 
 import java.util.ArrayList;
 import java.util.List;
 
+import static org.junit.Assert.assertEquals;
 import static org.mockito.Matchers.anyInt;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.never;
@@ -35,6 +40,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class CallAudioModeStateMachineTest extends StateMachineTestBase<CallAudioModeStateMachine> {
     private static class ModeTestParameters extends TestParameters {
         public String name;
@@ -91,18 +97,21 @@
     @Mock private CallAudioManager mCallAudioManager;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         mContext = mComponentContextFixture.getTestDouble().getApplicationContext();
     }
 
     @LargeTest
+    @Test
     public void testTransitions() throws Throwable {
         List<ModeTestParameters> testCases = generateTestCases();
         parametrizedTestStateMachine(testCases);
     }
 
     @SmallTest
+    @Test
     public void testNoFocusWhenRingerSilenced() throws Throwable {
         CallAudioModeStateMachine sm = new CallAudioModeStateMachine(mAudioManager);
         sm.setCallAudioManager(mCallAudioManager);
diff --git a/tests/src/com/android/server/telecom/tests/CallAudioRouteStateMachineTest.java b/tests/src/com/android/server/telecom/tests/CallAudioRouteStateMachineTest.java
index cb6bbba..4f91df0 100644
--- a/tests/src/com/android/server/telecom/tests/CallAudioRouteStateMachineTest.java
+++ b/tests/src/com/android/server/telecom/tests/CallAudioRouteStateMachineTest.java
@@ -37,6 +37,10 @@
 import com.android.server.telecom.TelecomSystem;
 import com.android.server.telecom.WiredHeadsetManager;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
@@ -49,7 +53,9 @@
 import java.util.Collections;
 import java.util.List;
 
-import static org.mockito.ArgumentMatchers.isNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.nullable;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.same;
@@ -63,6 +69,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class CallAudioRouteStateMachineTest
         extends StateMachineTestBase<CallAudioRouteStateMachine> {
     private static final int NONE = 0;
@@ -162,6 +169,7 @@
     private final TelecomSystem.SyncRoot mLock = new TelecomSystem.SyncRoot() { };
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         MockitoAnnotations.initMocks(this);
@@ -187,6 +195,7 @@
     }
 
     @SmallTest
+    @Test
     public void testEarpieceAutodetect() {
         CallAudioRouteStateMachine stateMachine = new CallAudioRouteStateMachine(
                 mContext,
@@ -204,18 +213,21 @@
     }
 
     @LargeTest
+    @Test
     public void testStateMachineTransitionsWithFocus() throws Throwable {
         List<RoutingTestParameters> paramList = generateTransitionTests(true);
         parametrizedTestStateMachine(paramList);
     }
 
     @LargeTest
+    @Test
     public void testStateMachineTransitionsWithoutFocus() throws Throwable {
         List<RoutingTestParameters> paramList = generateTransitionTests(false);
         parametrizedTestStateMachine(paramList);
     }
 
     @MediumTest
+    @Test
     public void testSpeakerPersistence() {
         CallAudioRouteStateMachine stateMachine = new CallAudioRouteStateMachine(
                 mContext,
@@ -259,6 +271,7 @@
     }
 
     @MediumTest
+    @Test
     public void testUserBluetoothSwitchOff() {
         CallAudioRouteStateMachine stateMachine = new CallAudioRouteStateMachine(
                 mContext,
@@ -300,6 +313,7 @@
     }
 
     @MediumTest
+    @Test
     public void testUserBluetoothSwitchOffAndOnAgain() {
         CallAudioRouteStateMachine stateMachine = new CallAudioRouteStateMachine(
                 mContext,
@@ -371,6 +385,7 @@
     }
 
     @MediumTest
+    @Test
     public void testBluetoothRinging() {
         CallAudioRouteStateMachine stateMachine = new CallAudioRouteStateMachine(
                 mContext,
@@ -404,6 +419,7 @@
     }
 
     @MediumTest
+    @Test
     public void testConnectBluetoothDuringRinging() {
         CallAudioRouteStateMachine stateMachine = new CallAudioRouteStateMachine(
                 mContext,
@@ -449,6 +465,7 @@
     }
 
     @SmallTest
+    @Test
     public void testConnectSpecificBluetoothDevice() {
         CallAudioRouteStateMachine stateMachine = new CallAudioRouteStateMachine(
                 mContext,
@@ -496,6 +513,7 @@
     }
 
     @SmallTest
+    @Test
     public void testInitializationWithEarpieceNoHeadsetNoBluetooth() {
         CallAudioState expectedState = new CallAudioState(false, CallAudioState.ROUTE_EARPIECE,
                 CallAudioState.ROUTE_EARPIECE | CallAudioState.ROUTE_SPEAKER);
@@ -503,6 +521,7 @@
     }
 
     @SmallTest
+    @Test
     public void testInitializationWithEarpieceAndHeadsetNoBluetooth() {
         CallAudioState expectedState = new CallAudioState(false, CallAudioState.ROUTE_WIRED_HEADSET,
                 CallAudioState.ROUTE_WIRED_HEADSET | CallAudioState.ROUTE_SPEAKER);
@@ -510,6 +529,7 @@
     }
 
     @SmallTest
+    @Test
     public void testInitializationWithEarpieceAndHeadsetAndBluetooth() {
         CallAudioState expectedState = new CallAudioState(false, CallAudioState.ROUTE_BLUETOOTH,
                 CallAudioState.ROUTE_WIRED_HEADSET | CallAudioState.ROUTE_SPEAKER
@@ -518,6 +538,7 @@
     }
 
     @SmallTest
+    @Test
     public void testInitializationWithEarpieceAndBluetoothNoHeadset() {
         CallAudioState expectedState = new CallAudioState(false, CallAudioState.ROUTE_BLUETOOTH,
                 CallAudioState.ROUTE_EARPIECE | CallAudioState.ROUTE_SPEAKER
@@ -526,6 +547,7 @@
     }
 
     @SmallTest
+    @Test
     public void testInitializationWithNoEarpieceNoHeadsetNoBluetooth() {
         CallAudioState expectedState = new CallAudioState(false, CallAudioState.ROUTE_SPEAKER,
                 CallAudioState.ROUTE_SPEAKER);
@@ -533,6 +555,7 @@
     }
 
     @SmallTest
+    @Test
     public void testInitializationWithHeadsetNoBluetoothNoEarpiece() {
         CallAudioState expectedState = new CallAudioState(false, CallAudioState.ROUTE_WIRED_HEADSET,
                 CallAudioState.ROUTE_WIRED_HEADSET | CallAudioState.ROUTE_SPEAKER);
@@ -540,6 +563,7 @@
     }
 
     @SmallTest
+    @Test
     public void testInitializationWithHeadsetAndBluetoothNoEarpiece() {
         CallAudioState expectedState = new CallAudioState(false, CallAudioState.ROUTE_BLUETOOTH,
                 CallAudioState.ROUTE_WIRED_HEADSET | CallAudioState.ROUTE_SPEAKER
@@ -548,6 +572,7 @@
     }
 
     @SmallTest
+    @Test
     public void testInitializationWithBluetoothNoHeadsetNoEarpiece() {
         CallAudioState expectedState = new CallAudioState(false, CallAudioState.ROUTE_BLUETOOTH,
                 CallAudioState.ROUTE_SPEAKER | CallAudioState.ROUTE_BLUETOOTH);
diff --git a/tests/src/com/android/server/telecom/tests/CallExtrasTest.java b/tests/src/com/android/server/telecom/tests/CallExtrasTest.java
index e9cd733..44578c5 100644
--- a/tests/src/com/android/server/telecom/tests/CallExtrasTest.java
+++ b/tests/src/com/android/server/telecom/tests/CallExtrasTest.java
@@ -25,12 +25,24 @@
 import android.test.suitebuilder.annotation.LargeTest;
 import android.test.suitebuilder.annotation.MediumTest;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 /**
  * Tests the {@link Connection} and {@link Call} extras functionality.
  */
+@RunWith(JUnit4.class)
 public class CallExtrasTest extends TelecomSystemTest {
 
     public final static String EXTRA_KEY_STR = "STRINGKEY";
@@ -41,6 +53,18 @@
     public final static String EXTRA_VALUE2_STR = "mozzarella";
     public final static int EXTRA_VALUE_INT = 1234;
 
+    @Override
+    @Before
+    public void setUp() throws Exception {
+        super.setUp();
+    }
+
+    @Override
+    @After
+    public void tearDown() throws Exception {
+        super.tearDown();
+    }
+
     /**
      * Tests setting extras on the connection side and ensuring they are propagated through to
      * the InCallService.
@@ -48,6 +72,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testCsPutExtras() throws Exception {
         // Get a call up and running.
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
@@ -74,6 +99,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testCsPutBooleanExtra() throws Exception {
         // Get a call up and running.
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
@@ -95,6 +121,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testCsPutIntExtra() throws Exception {
         // Get a call up and running.
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
@@ -116,6 +143,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testCsPutStringExtra() throws Exception {
         // Get a call up and running.
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
@@ -138,6 +166,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testCsRemoveExtra() throws Exception {
         // Get a call up and running."STRING"
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
@@ -168,6 +197,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testCsUpdateExisting() throws Exception {
         // Get a call up and running.
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
@@ -204,6 +234,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testCsSetExtras() throws Exception {
         // Get a call up and running.
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
@@ -243,6 +274,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testICSPutExtras() throws Exception {
         Bundle extras = new Bundle();
         extras.putString(EXTRA_KEY_STR, EXTRA_VALUE_STR);
@@ -270,6 +302,7 @@
      * @throws Exception
      */
     @LargeTest
+    @Test
     public void testExtrasBidirectional() throws Exception {
         // Get a call up and running.
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
@@ -322,6 +355,7 @@
      * @throws Exception
      */
     @LargeTest
+    @Test
     public void testConferenceSetExtras() throws Exception {
         ParcelableCall call = makeConferenceCall();
         String conferenceId = call.getId();
@@ -364,6 +398,7 @@
      * @throws Exception
      */
     @LargeTest
+    @Test
     public void testConferenceExtraOperations() throws Exception {
         ParcelableCall call = makeConferenceCall();
         String conferenceId = call.getId();
@@ -399,6 +434,7 @@
      * @throws Exception
      */
     @LargeTest
+    @Test
     public void testConferenceICS() throws Exception {
         ParcelableCall call = makeConferenceCall();
         String conferenceId = call.getId();
diff --git a/tests/src/com/android/server/telecom/tests/CallLogManagerTest.java b/tests/src/com/android/server/telecom/tests/CallLogManagerTest.java
index 3bf044c..52f1b0f 100644
--- a/tests/src/com/android/server/telecom/tests/CallLogManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/CallLogManagerTest.java
@@ -48,9 +48,12 @@
 import com.android.server.telecom.CallState;
 import com.android.server.telecom.MissedCallNotifier;
 import com.android.server.telecom.PhoneAccountRegistrar;
-import com.android.server.telecom.R;
 import com.android.server.telecom.TelephonyUtil;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.eq;
@@ -61,14 +64,18 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
 import java.util.Arrays;
-import java.util.Locale;
 
+@RunWith(JUnit4.class)
 public class CallLogManagerTest extends TelecomTestCase {
 
     private CallLogManager mCallLogManager;
@@ -103,6 +110,7 @@
     MissedCallNotifier mMissedCallNotifier;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         mContext = mComponentContextFixture.getTestDouble().getApplicationContext();
@@ -153,6 +161,7 @@
     }
 
     @MediumTest
+    @Test
     public void testDontLogCancelledCall() {
         Call fakeCall = makeFakeCall(
                 DisconnectCause.CANCELED,
@@ -174,6 +183,7 @@
     }
 
     @MediumTest
+    @Test
     public void testDontLogChoosingAccountCall() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -196,6 +206,7 @@
     }
 
     @MediumTest
+    @Test
     public void testDontLogCallsFromEmergencyAccount() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(EMERGENCY_ACCT_HANDLE, 0));
@@ -224,6 +235,7 @@
     }
 
     @MediumTest
+    @Test
     public void testLogCallDirectionOutgoing() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -248,6 +260,7 @@
     }
 
     @MediumTest
+    @Test
     public void testLogCallDirectionIncoming() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -272,6 +285,7 @@
     }
 
     @MediumTest
+    @Test
     public void testLogCallDirectionMissed() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -300,6 +314,7 @@
     }
 
     @MediumTest
+    @Test
     public void testLogCallDirectionRejected() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -325,6 +340,7 @@
     }
 
     @MediumTest
+    @Test
     public void testCreationTimeAndAge() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -352,6 +368,7 @@
     }
 
     @MediumTest
+    @Test
     public void testLogPhoneAccountId() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -375,6 +392,7 @@
     }
 
     @MediumTest
+    @Test
     public void testLogCorrectPhoneNumber() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -401,6 +419,7 @@
     }
 
     @MediumTest
+    @Test
     public void testLogCallVideoFeatures() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -425,6 +444,7 @@
 
     @MediumTest
     @FlakyTest
+    @Test
     public void testLogCallDirectionOutgoingWithMultiUserCapability() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mOtherUserAccountHandle,
@@ -457,6 +477,7 @@
     }
 
     @MediumTest
+    @Test
     public void testLogCallDirectionIncomingWithMultiUserCapability() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mOtherUserAccountHandle,
@@ -489,6 +510,7 @@
     }
 
     @MediumTest
+    @Test
     public void testLogCallDirectionOutgoingWithMultiUserCapabilityFromManagedProfile() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mManagedProfileAccountHandle,
@@ -519,6 +541,7 @@
 
     @MediumTest
     @FlakyTest
+    @Test
     public void testLogCallDirectionOutgoingFromManagedProfile() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mManagedProfileAccountHandle, 0));
@@ -548,6 +571,7 @@
     }
 
     @MediumTest
+    @Test
     public void testLogCallDirectionIngoingFromManagedProfile() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mManagedProfileAccountHandle, 0));
@@ -580,6 +604,7 @@
      * Ensure call data usage is persisted to the call log when present in the call.
      */
     @MediumTest
+    @Test
     public void testLogCallDataUsageSet() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -606,6 +631,7 @@
      * Ensures call data usage is null in the call log when not set on the call.
      */
     @MediumTest
+    @Test
     public void testLogCallDataUsageNotSet() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -629,6 +655,7 @@
     }
 
     @SmallTest
+    @Test
     public void testCountryIso_setCache() {
         Country testCountry = new Country(TEST_ISO, Country.COUNTRY_SOURCE_LOCALE);
         CountryDetector mockDetector = (CountryDetector) mContext.getSystemService(
@@ -641,6 +668,7 @@
     }
 
     @SmallTest
+    @Test
     public void testCountryIso_newCountryDetected() {
         Country testCountry = new Country(TEST_ISO, Country.COUNTRY_SOURCE_LOCALE);
         Country testCountry2 = new Country(TEST_ISO_2, Country.COUNTRY_SOURCE_LOCALE);
diff --git a/tests/src/com/android/server/telecom/tests/CallScreeningServiceFilterTest.java b/tests/src/com/android/server/telecom/tests/CallScreeningServiceFilterTest.java
index 6782d52..a319fad 100644
--- a/tests/src/com/android/server/telecom/tests/CallScreeningServiceFilterTest.java
+++ b/tests/src/com/android/server/telecom/tests/CallScreeningServiceFilterTest.java
@@ -15,6 +15,7 @@
  */
 
 package com.android.server.telecom.tests;
+
 import android.Manifest;
 import android.content.ComponentName;
 import android.content.Context;
@@ -37,29 +38,32 @@
 import com.android.server.telecom.DefaultDialerCache;
 import com.android.server.telecom.ParcelableCallUtils;
 import com.android.server.telecom.PhoneAccountRegistrar;
-import com.android.server.telecom.TelecomServiceImpl;
 import com.android.server.telecom.callfiltering.CallFilterResultCallback;
 import com.android.server.telecom.callfiltering.CallFilteringResult;
 import com.android.server.telecom.callfiltering.CallScreeningServiceFilter;
 import com.android.server.telecom.TelecomSystem;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 
 import java.util.Collections;
 
+import static org.junit.Assert.assertEquals;
 import static org.mockito.ArgumentMatchers.nullable;
-import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyBoolean;
 import static org.mockito.Matchers.anyInt;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class CallScreeningServiceFilterTest extends TelecomTestCase {
     @Mock Context mContext;
     @Mock CallsManager mCallsManager;
@@ -90,13 +94,14 @@
     );
 
     private CallScreeningServiceFilter mFilter;
+
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         when(mCallsManager.getCurrentUserHandle()).thenReturn(UserHandle.CURRENT);
         when(mContext.getPackageManager()).thenReturn(mPackageManager);
         when(mCall.getId()).thenReturn(CALL_ID);
-//        when(mBinder.queryLocalInterface(anyString())).thenReturn(mCallScreeningService);
         doReturn(mCallScreeningService).when(mBinder).queryLocalInterface(anyString());
 
         mResolveInfo =  new ResolveInfo() {{
@@ -120,6 +125,7 @@
     }
 
     @SmallTest
+    @Test
     public void testNoDefaultDialer() {
         when(mDefaultDialerCache.getDefaultDialerApplication(eq(UserHandle.USER_CURRENT)))
                 .thenReturn(null);
@@ -128,6 +134,7 @@
     }
 
     @SmallTest
+    @Test
     public void testNoResolveEntries() {
         when(mPackageManager.queryIntentServicesAsUser(nullable(Intent.class), anyInt(), anyInt()))
                 .thenReturn(Collections.emptyList());
@@ -136,6 +143,7 @@
     }
 
     @SmallTest
+    @Test
     public void testBadResolveEntry() {
         mResolveInfo.serviceInfo = null;
         mFilter.startFilterLookup(mCall, mCallback);
@@ -143,6 +151,7 @@
     }
 
     @SmallTest
+    @Test
     public void testPermissionlessFilterService() {
         mResolveInfo.serviceInfo.permission = null;
         mFilter.startFilterLookup(mCall, mCallback);
@@ -150,6 +159,7 @@
     }
 
     @SmallTest
+    @Test
     public void testContextFailToBind() {
         when(mContext.bindServiceAsUser(nullable(Intent.class), nullable(ServiceConnection.class),
                 anyInt(), eq(UserHandle.CURRENT))).thenReturn(false);
@@ -158,6 +168,7 @@
     }
 
     @SmallTest
+    @Test
     public void testExceptionInScreeningService() throws Exception {
         doThrow(new RemoteException()).when(mCallScreeningService).screenCall(
                 nullable(ICallScreeningAdapter.class), nullable(ParcelableCall.class));
@@ -168,6 +179,7 @@
     }
 
     @SmallTest
+    @Test
     public void testAllowCall() throws Exception {
         mFilter.startFilterLookup(mCall, mCallback);
         ServiceConnection serviceConnection = verifyBindingIntent();
@@ -178,6 +190,7 @@
     }
 
     @SmallTest
+    @Test
     public void testDisallowCall() throws Exception {
         mFilter.startFilterLookup(mCall, mCallback);
         ServiceConnection serviceConnection = verifyBindingIntent();
diff --git a/tests/src/com/android/server/telecom/tests/CallerInfoLookupHelperTest.java b/tests/src/com/android/server/telecom/tests/CallerInfoLookupHelperTest.java
index 2ae717d..74d07d8 100644
--- a/tests/src/com/android/server/telecom/tests/CallerInfoLookupHelperTest.java
+++ b/tests/src/com/android/server/telecom/tests/CallerInfoLookupHelperTest.java
@@ -21,36 +21,40 @@
 import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
+import android.support.test.InstrumentationRegistry;
 import android.test.suitebuilder.annotation.SmallTest;
 import android.telecom.Logging.Session;
 
 import com.android.internal.telephony.CallerInfo;
 import com.android.internal.telephony.CallerInfoAsyncQuery;
-import com.android.server.telecom.Call;
 import com.android.server.telecom.CallerInfoAsyncQueryFactory;
 import com.android.server.telecom.CallerInfoLookupHelper;
 import com.android.server.telecom.ContactsAsyncHelper;
 import com.android.server.telecom.TelecomSystem;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 
 import java.io.FileNotFoundException;
 import java.io.InputStream;
-import java.net.URI;
 import java.util.concurrent.CountDownLatch;
 
+import static org.junit.Assert.assertEquals;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyInt;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Matchers.isNull;
-import static org.mockito.Mockito.atMost;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class CallerInfoLookupHelperTest extends TelecomTestCase {
     @Mock Context mContext;
     @Mock CallerInfoAsyncQueryFactory mFactory;
@@ -72,6 +76,7 @@
     Bitmap mBitmap;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         mCallerInfoLookupHelper = new CallerInfoLookupHelper(mContext,
@@ -85,7 +90,8 @@
         if (mBitmap == null) {
             InputStream is;
             try {
-                is = getTestContext().getContentResolver().openInputStream(CONTACTS_PHOTO_URI);
+                is = InstrumentationRegistry.getContext()
+                        .getContentResolver().openInputStream(CONTACTS_PHOTO_URI);
             } catch (FileNotFoundException e) {
                 return;
             }
@@ -96,6 +102,7 @@
     }
 
     @SmallTest
+    @Test
     public void testLookupWithEmptyHandle() {
         CallerInfoLookupHelper.OnQueryCompleteListener listener = mock(
                 CallerInfoLookupHelper.OnQueryCompleteListener.class);
@@ -105,6 +112,8 @@
         verifyProperCleanup();
     }
 
+    @SmallTest
+    @Test
     public void testSimpleLookup() {
         CallerInfoLookupHelper.OnQueryCompleteListener listener = mock(
                 CallerInfoLookupHelper.OnQueryCompleteListener.class);
@@ -140,6 +149,8 @@
         verifyProperCleanup();
     }
 
+    @SmallTest
+    @Test
     public void testLookupWithTwoListeners() {
         CallerInfoLookupHelper.OnQueryCompleteListener callListener = mock(
                 CallerInfoLookupHelper.OnQueryCompleteListener.class);
@@ -179,6 +190,8 @@
         verifyProperCleanup();
     }
 
+    @SmallTest
+    @Test
     public void testListenerAddedAfterCallerInfoBeforePhoto() {
         CallerInfoLookupHelper.OnQueryCompleteListener callListener = mock(
                 CallerInfoLookupHelper.OnQueryCompleteListener.class);
diff --git a/tests/src/com/android/server/telecom/tests/CallsManagerTest.java b/tests/src/com/android/server/telecom/tests/CallsManagerTest.java
index 714261a..bf9decb 100644
--- a/tests/src/com/android/server/telecom/tests/CallsManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/CallsManagerTest.java
@@ -16,6 +16,8 @@
 
 package com.android.server.telecom.tests;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.ArgumentMatchers.anyChar;
@@ -62,6 +64,10 @@
 import com.android.server.telecom.WiredHeadsetManager;
 import com.android.server.telecom.bluetooth.BluetoothRouteManager;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
@@ -71,6 +77,7 @@
 import java.util.Collections;
 import java.util.List;
 
+@RunWith(JUnit4.class)
 public class CallsManagerTest extends TelecomTestCase {
     private static final PhoneAccountHandle SIM_1_HANDLE = new PhoneAccountHandle(
             ComponentName.unflattenFromString("com.foo/.Blah"), "Sim1");
@@ -123,6 +130,7 @@
     private CallsManager mCallsManager;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         MockitoAnnotations.initMocks(this);
@@ -168,6 +176,7 @@
     }
 
     @MediumTest
+    @Test
     public void testConstructPossiblePhoneAccounts() throws Exception {
         // Should be empty since the URI is null.
         assertEquals(0, mCallsManager.constructPossiblePhoneAccounts(null, null, false).size());
@@ -179,6 +188,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testConstructPossiblePhoneAccountsMultiSimActive() throws Exception {
         setupMsimAccounts();
 
@@ -212,6 +222,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testConstructPossiblePhoneAccountsMultiSimIdle() throws Exception {
         setupMsimAccounts();
 
@@ -226,6 +237,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testFindOutgoingCallPhoneAccountSelfManaged() throws Exception {
         List<PhoneAccountHandle> accounts = mCallsManager.findOutgoingCallPhoneAccount(
                 SELF_MANAGED_HANDLE, TEST_ADDRESS, false /* isVideo */, null /* userHandle */);
@@ -239,6 +251,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testFindOutgoingCallAccountDefault() throws Exception {
         when(mPhoneAccountRegistrar.getOutgoingPhoneAccountForScheme(any(), any())).thenReturn(
                 SIM_1_HANDLE);
@@ -260,6 +273,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testFindOutgoingCallAccountNoDefault() throws Exception {
         when(mPhoneAccountRegistrar.getOutgoingPhoneAccountForScheme(any(), any())).thenReturn(
                 null);
@@ -281,6 +295,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testFindOutgoingCallAccountVideo() throws Exception {
         when(mPhoneAccountRegistrar.getOutgoingPhoneAccountForScheme(any(), any())).thenReturn(
                 null);
@@ -301,6 +316,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testFindOutgoingCallAccountVideoNotAvailable() throws Exception {
         when(mPhoneAccountRegistrar.getOutgoingPhoneAccountForScheme(any(), any())).thenReturn(
                 null);
@@ -325,6 +341,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testUseSpecifiedAccount() throws Exception {
         when(mPhoneAccountRegistrar.getOutgoingPhoneAccountForScheme(any(), any())).thenReturn(
                 null);
@@ -344,6 +361,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testPlayDtmfWhenActive() throws Exception {
         Call callSpy = addSpyCall();
         mCallsManager.playDtmfTone(callSpy, '1');
@@ -355,6 +373,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testSuppessDtmfWhenHeld() throws Exception {
         Call callSpy = addSpyCall();
         callSpy.setState(CallState.ON_HOLD, "test");
@@ -368,6 +387,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testCancelDtmfWhenHeld() throws Exception {
         Call callSpy = addSpyCall();
         mCallsManager.playDtmfTone(callSpy, '1');
diff --git a/tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java b/tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
index 27202cf..9cdd120 100644
--- a/tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
+++ b/tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
@@ -26,6 +26,7 @@
 import org.mockito.Mockito;
 
 import android.content.ComponentName;
+import android.content.Context;
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.IBinder;
@@ -76,6 +77,10 @@
         int mCapabilities = NOT_SPECIFIED;
         int mProperties = NOT_SPECIFIED;
 
+        public FakeConnectionServiceDelegate(Context base) {
+            attachBaseContext(base);
+        }
+
         @Override
         public Connection onCreateUnknownConnection(
                 PhoneAccountHandle connectionManagerPhoneAccount, ConnectionRequest request) {
@@ -377,10 +382,8 @@
                                    int error, Session.Info sessionInfo) {}
     }
 
-    FakeConnectionServiceDelegate mConnectionServiceDelegate =
-            new FakeConnectionServiceDelegate();
-    private IConnectionService mConnectionServiceDelegateAdapter =
-            IConnectionService.Stub.asInterface(mConnectionServiceDelegate.onBind(null));
+    FakeConnectionServiceDelegate mConnectionServiceDelegate;
+    private IConnectionService mConnectionServiceDelegateAdapter;
 
     FakeConnectionService mConnectionService = new FakeConnectionService();
     private IConnectionService.Stub mConnectionServiceSpy = Mockito.spy(mConnectionService);
@@ -435,7 +438,11 @@
     public final List<ComponentName> mRemoteConnectionServiceNames = new ArrayList<>();
     public final List<IBinder> mRemoteConnectionServices = new ArrayList<>();
 
-    public ConnectionServiceFixture() throws Exception { }
+    public ConnectionServiceFixture(Context context) throws Exception {
+        mConnectionServiceDelegate = new FakeConnectionServiceDelegate(context);
+        mConnectionServiceDelegateAdapter = IConnectionService.Stub.asInterface(
+                mConnectionServiceDelegate.onBind(null));
+    }
 
     @Override
     public IConnectionService getTestDouble() {
diff --git a/tests/src/com/android/server/telecom/tests/ConnectionServiceFocusManagerTest.java b/tests/src/com/android/server/telecom/tests/ConnectionServiceFocusManagerTest.java
index affa4e9..bd855f9 100644
--- a/tests/src/com/android/server/telecom/tests/ConnectionServiceFocusManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/ConnectionServiceFocusManagerTest.java
@@ -23,10 +23,19 @@
 import com.android.server.telecom.CallsManager;
 import com.android.server.telecom.ConnectionServiceFocusManager;
 import com.android.server.telecom.ConnectionServiceFocusManager.*;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.reset;
@@ -34,6 +43,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class ConnectionServiceFocusManagerTest extends TelecomTestCase {
 
     @Mock CallsManagerRequester mockCallsManagerRequester;
@@ -50,6 +60,7 @@
     private CallsManager.CallsManagerListener mCallsManagerListener;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         mFocusManagerUT = new ConnectionServiceFocusManager(
@@ -63,6 +74,7 @@
     }
 
     @SmallTest
+    @Test
     public void testRequestFocusWithoutActiveFocusExisted() {
         // GIVEN the ConnectionServiceFocusManager without focus ConnectionService.
 
@@ -74,6 +86,7 @@
     }
 
     @SmallTest
+    @Test
     public void testRequestFocusWithActiveFocusExisted() {
         // GIVEN the ConnectionServiceFocusManager with the focus ConnectionService.
         requestFocus(mActiveCall, null);
@@ -106,6 +119,7 @@
     }
 
     @SmallTest
+    @Test
     public void testRequestConnectionServiceSameAsFocusConnectionService() {
         // GIVEN the ConnectionServiceFocusManager with the focus ConnectionService.
         requestFocus(mActiveCall, null);
@@ -122,6 +136,7 @@
     }
 
     @SmallTest
+    @Test
     public void testFocusConnectionServiceDoesNotRespondToFocusLost() {
         // GIVEN the ConnectionServiceFocusManager with the focus ConnectionService.
         requestFocus(mActiveCall, null);
@@ -148,6 +163,7 @@
     }
 
     @SmallTest
+    @Test
     public void testNonFocusConnectionServiceReleased() {
         // GIVEN the ConnectionServiceFocusManager with the focus ConnectionService
         requestFocus(mActiveCall, null);
@@ -163,6 +179,7 @@
     }
 
     @SmallTest
+    @Test
     public void testFocusConnectionServiceReleased() {
         // GIVEN the ConnectionServiceFocusManager with the focus ConnectionService
         requestFocus(mActiveCall, null);
@@ -179,6 +196,7 @@
     }
 
     @SmallTest
+    @Test
     public void testCallStateChangedAffectCallFocus() {
         // GIVEN the ConnectionServiceFocusManager with the focus ConnectionService.
         CallFocus activeCall = createFakeCall(mActiveConnectionService, CallState.ACTIVE);
@@ -207,6 +225,7 @@
     }
 
     @SmallTest
+    @Test
     public void testCallStateChangedDoesNotAffectCallFocusIfConnectionServiceIsDifferent() {
         // GIVEN the ConnectionServiceFocusManager with the focus ConnectionService
         requestFocus(mActiveCall, null);
@@ -229,6 +248,7 @@
     }
 
     @SmallTest
+    @Test
     public void testFocusCallIsNullWhenRemoveTheFocusCall() {
         // GIVEN the ConnectionServiceFocusManager with the focus ConnectionService
         requestFocus(mActiveCall, null);
@@ -243,6 +263,7 @@
     }
 
     @SmallTest
+    @Test
     public void testConnectionServiceFocusDeath() {
         // GIVEN the ConnectionServiceFocusManager with the focus ConnectionService
         requestFocus(mActiveCall, null);
@@ -259,6 +280,7 @@
     }
 
     @SmallTest
+    @Test
     public void testNonExternalCallChangedToExternalCall() {
         // GIVEN the ConnectionServiceFocusManager with the focus ConnectionService.
         requestFocus(mActiveCall, null);
@@ -273,6 +295,7 @@
     }
 
     @SmallTest
+    @Test
     public void testExternalCallChangedToNonExternalCall() {
         // GIVEN the ConnectionServiceFocusManager without focus ConnectionService
 
diff --git a/tests/src/com/android/server/telecom/tests/ContactsAsyncHelperTest.java b/tests/src/com/android/server/telecom/tests/ContactsAsyncHelperTest.java
index 960a170..81263ae 100644
--- a/tests/src/com/android/server/telecom/tests/ContactsAsyncHelperTest.java
+++ b/tests/src/com/android/server/telecom/tests/ContactsAsyncHelperTest.java
@@ -21,15 +21,21 @@
 import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
+import android.support.test.InstrumentationRegistry;
 import android.test.suitebuilder.annotation.SmallTest;
 
 import com.android.server.telecom.ContactsAsyncHelper;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 
 import java.io.FileNotFoundException;
 import java.io.InputStream;
 
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyInt;
 import static org.mockito.Matchers.anyObject;
@@ -40,6 +46,7 @@
 import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.verify;
 
+@RunWith(JUnit4.class)
 public class ContactsAsyncHelperTest extends TelecomTestCase {
     private static final Uri SAMPLE_CONTACT_PHOTO_URI = Uri.parse(
             "android.resource://com.android.server.telecom.tests/"
@@ -82,12 +89,14 @@
             };
 
     @Override
+    @Before
     public void setUp() throws Exception {
-        mContext = getTestContext();
         super.setUp();
+        mContext = InstrumentationRegistry.getTargetContext();
     }
 
     @SmallTest
+    @Test
     public void testEmptyUri() throws Exception {
         ContactsAsyncHelper cah = new ContactsAsyncHelper(mNullContentResolverAdapter);
         try {
@@ -101,6 +110,7 @@
     }
 
     @SmallTest
+    @Test
     public void testNullReturnFromOpenInputStream() {
         ContactsAsyncHelper cah = new ContactsAsyncHelper(mNullContentResolverAdapter);
         cah.startObtainPhotoAsync(TOKEN, mContext, SAMPLE_CONTACT_PHOTO_URI, mListener, COOKIE);
@@ -110,6 +120,7 @@
     }
 
     @SmallTest
+    @Test
     public void testImageScaling() {
         ContactsAsyncHelper cah = new ContactsAsyncHelper(mWorkingContentResolverAdapter);
         cah.startObtainPhotoAsync(TOKEN, mContext, SAMPLE_CONTACT_PHOTO_URI, mListener, COOKIE);
@@ -129,6 +140,7 @@
     }
 
     @SmallTest
+    @Test
     public void testNoScaling() {
         ContactsAsyncHelper cah = new ContactsAsyncHelper(mWorkingContentResolverAdapter);
         cah.startObtainPhotoAsync(TOKEN, mContext, SAMPLE_CONTACT_PHOTO_URI_SMALL,
diff --git a/tests/src/com/android/server/telecom/tests/CreateConnectionProcessorTest.java b/tests/src/com/android/server/telecom/tests/CreateConnectionProcessorTest.java
index 350afa3..be8b9b9 100644
--- a/tests/src/com/android/server/telecom/tests/CreateConnectionProcessorTest.java
+++ b/tests/src/com/android/server/telecom/tests/CreateConnectionProcessorTest.java
@@ -20,7 +20,6 @@
 import android.graphics.drawable.Icon;
 import android.net.Uri;
 import android.os.Binder;
-import android.os.Debug;
 import android.telecom.DisconnectCause;
 import android.telecom.PhoneAccount;
 import android.telecom.PhoneAccountHandle;
@@ -34,6 +33,11 @@
 import com.android.server.telecom.CreateConnectionResponse;
 import com.android.server.telecom.PhoneAccountRegistrar;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 
@@ -51,6 +55,7 @@
 /**
  * Unit testing for CreateConnectionProcessor as well as CreateConnectionTimeout classes.
  */
+@RunWith(JUnit4.class)
 public class CreateConnectionProcessorTest extends TelecomTestCase {
 
     private static final String TEST_PACKAGE = "com.android.server.telecom.tests";
@@ -69,6 +74,7 @@
     CreateConnectionProcessor mTestCreateConnectionProcessor;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         MockitoAnnotations.initMocks(this);
@@ -80,12 +86,14 @@
     }
 
     @Override
+    @After
     public void tearDown() throws Exception {
         mTestCreateConnectionProcessor = null;
         super.tearDown();
     }
 
     @SmallTest
+    @Test
     public void testSimPhoneAccountSuccess() throws Exception {
         PhoneAccountHandle pAHandle = getNewTargetPhoneAccountHandle("tel_acct");
         when(mMockCall.isEmergencyCall()).thenReturn(false);
@@ -106,6 +114,7 @@
     }
 
     @SmallTest
+    @Test
     public void testbadPhoneAccount() throws Exception {
         PhoneAccountHandle pAHandle = null;
         when(mMockCall.isEmergencyCall()).thenReturn(false);
@@ -124,6 +133,7 @@
     }
 
     @SmallTest
+    @Test
     public void testConnectionManagerSuccess() throws Exception {
         PhoneAccountHandle pAHandle = getNewTargetPhoneAccountHandle("tel_acct");
         when(mMockCall.isEmergencyCall()).thenReturn(false);
@@ -149,6 +159,7 @@
     }
 
     @SmallTest
+    @Test
     public void testConnectionManagerFailedFallToSim() throws Exception {
         PhoneAccountHandle pAHandle = getNewTargetPhoneAccountHandle("tel_acct");
         when(mMockCall.isEmergencyCall()).thenReturn(false);
@@ -184,6 +195,7 @@
     }
 
     @SmallTest
+    @Test
     public void testConnectionManagerFailedDoNotFallToSim() throws Exception {
         PhoneAccountHandle pAHandle = getNewTargetPhoneAccountHandle("tel_acct");
         when(mMockCall.isEmergencyCall()).thenReturn(false);
@@ -214,6 +226,7 @@
     }
 
     @SmallTest
+    @Test
     public void testEmergencyCallToSim() throws Exception {
         when(mMockCall.isEmergencyCall()).thenReturn(true);
         // Put in a regular phone account to be sure it doesn't call that
@@ -237,6 +250,7 @@
     }
 
     @SmallTest
+    @Test
     public void testEmergencyCallSimFailToConnectionManager() throws Exception {
         when(mMockCall.isEmergencyCall()).thenReturn(true);
         when(mMockCall.getHandle()).thenReturn(Uri.parse(""));
diff --git a/tests/src/com/android/server/telecom/tests/DefaultDialerCacheTest.java b/tests/src/com/android/server/telecom/tests/DefaultDialerCacheTest.java
index 82fee3e..94e6631 100644
--- a/tests/src/com/android/server/telecom/tests/DefaultDialerCacheTest.java
+++ b/tests/src/com/android/server/telecom/tests/DefaultDialerCacheTest.java
@@ -29,9 +29,14 @@
 import com.android.server.telecom.DefaultDialerCache;
 import com.android.server.telecom.TelecomSystem;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 
+import static org.junit.Assert.assertEquals;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Matchers.isNull;
@@ -39,6 +44,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class DefaultDialerCacheTest extends TelecomTestCase {
 
     private static final String DIALER1 = "com.android.dialer";
@@ -55,6 +61,8 @@
 
     @Mock private DefaultDialerCache.DefaultDialerManagerAdapter mMockDefaultDialerManager;
 
+    @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         mContext = mComponentContextFixture.getTestDouble().getApplicationContext();
@@ -88,6 +96,7 @@
     }
 
     @SmallTest
+    @Test
     public void testThreeUsers() {
         assertEquals(mDefaultDialerCache.getDefaultDialerApplication(), DIALER1);
         assertEquals(mDefaultDialerCache.getDefaultDialerApplication(USER0), DIALER1);
@@ -107,6 +116,7 @@
     }
 
     @SmallTest
+    @Test
     public void testDialer1PackageChanged() {
         // Populate the caches first
         assertEquals(mDefaultDialerCache.getDefaultDialerApplication(USER0), DIALER1);
@@ -129,6 +139,7 @@
     }
 
     @SmallTest
+    @Test
     public void testRandomOtherPackageChanged() {
         assertEquals(mDefaultDialerCache.getDefaultDialerApplication(USER0), DIALER1);
         assertEquals(mDefaultDialerCache.getDefaultDialerApplication(USER1), DIALER2);
@@ -146,6 +157,7 @@
     }
 
     @SmallTest
+    @Test
     public void testUserRemoved() {
         assertEquals(mDefaultDialerCache.getDefaultDialerApplication(USER0), DIALER1);
         assertEquals(mDefaultDialerCache.getDefaultDialerApplication(USER1), DIALER2);
@@ -164,6 +176,7 @@
     }
 
     @SmallTest
+    @Test
     public void testPackageRemovedWithoutReplace() {
         assertEquals(mDefaultDialerCache.getDefaultDialerApplication(USER0), DIALER1);
         assertEquals(mDefaultDialerCache.getDefaultDialerApplication(USER1), DIALER2);
@@ -183,6 +196,7 @@
     }
 
     @SmallTest
+    @Test
     public void testPackageAdded() {
         assertEquals(mDefaultDialerCache.getDefaultDialerApplication(USER0), DIALER1);
         assertEquals(mDefaultDialerCache.getDefaultDialerApplication(USER1), DIALER2);
@@ -201,6 +215,7 @@
     }
 
     @SmallTest
+    @Test
     public void testPackageRemovedWithReplace() {
         assertEquals(mDefaultDialerCache.getDefaultDialerApplication(USER0), DIALER1);
         assertEquals(mDefaultDialerCache.getDefaultDialerApplication(USER1), DIALER2);
@@ -220,6 +235,7 @@
     }
 
     @SmallTest
+    @Test
     public void testDefaultDialerSettingChanged() {
         assertEquals(mDefaultDialerCache.getDefaultDialerApplication(USER0), DIALER1);
         assertEquals(mDefaultDialerCache.getDefaultDialerApplication(USER1), DIALER2);
diff --git a/tests/src/com/android/server/telecom/tests/DirectToVoicemailCallFilterTest.java b/tests/src/com/android/server/telecom/tests/DirectToVoicemailCallFilterTest.java
index 2ebb6fc..af4c168 100644
--- a/tests/src/com/android/server/telecom/tests/DirectToVoicemailCallFilterTest.java
+++ b/tests/src/com/android/server/telecom/tests/DirectToVoicemailCallFilterTest.java
@@ -26,6 +26,10 @@
 import com.android.server.telecom.callfiltering.CallFilteringResult;
 import com.android.server.telecom.callfiltering.DirectToVoicemailCallFilter;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 
@@ -33,6 +37,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class DirectToVoicemailCallFilterTest extends TelecomTestCase {
     @Mock private CallerInfoLookupHelper mCallerInfoLookupHelper;
     @Mock private CallFilterResultCallback mCallback;
@@ -40,11 +45,14 @@
 
     private static final Uri TEST_HANDLE = Uri.parse("tel:1235551234");
 
+    @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
     }
 
     @SmallTest
+    @Test
     public void testSendToVoicemail() {
         CallerInfoLookupHelper.OnQueryCompleteListener queryListener = verifyLookupStart();
 
@@ -62,6 +70,7 @@
     }
 
     @SmallTest
+    @Test
     public void testDontSendToVoicemail() {
         CallerInfoLookupHelper.OnQueryCompleteListener queryListener = verifyLookupStart();
 
@@ -79,6 +88,7 @@
     }
 
     @SmallTest
+    @Test
     public void testNullResponseFromLookupHelper() {
         CallerInfoLookupHelper.OnQueryCompleteListener queryListener = verifyLookupStart(null);
 
diff --git a/tests/src/com/android/server/telecom/tests/DtmfLocalTonePlayerTest.java b/tests/src/com/android/server/telecom/tests/DtmfLocalTonePlayerTest.java
index 223cb58..24dd18f 100644
--- a/tests/src/com/android/server/telecom/tests/DtmfLocalTonePlayerTest.java
+++ b/tests/src/com/android/server/telecom/tests/DtmfLocalTonePlayerTest.java
@@ -15,7 +15,6 @@
 
 package com.android.server.telecom.tests;
 
-import android.media.AudioManager;
 import android.media.ToneGenerator;
 import android.test.suitebuilder.annotation.SmallTest;
 
@@ -23,6 +22,10 @@
 import com.android.server.telecom.DtmfLocalTonePlayer;
 import com.android.server.telecom.R;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.Mock;
 
 import static org.mockito.Matchers.anyInt;
@@ -31,6 +34,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class DtmfLocalTonePlayerTest extends TelecomTestCase {
     private static final int TIMEOUT = 2000;
     @Mock DtmfLocalTonePlayer.ToneGeneratorProxy mToneProxy;
@@ -38,6 +42,7 @@
 
     DtmfLocalTonePlayer mPlayer;
 
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         mContext = mComponentContextFixture.getTestDouble().getApplicationContext();
@@ -46,6 +51,7 @@
     }
 
     @SmallTest
+    @Test
     public void testSupportedStart() {
         when(mContext.getResources().getBoolean(R.bool.allow_local_dtmf_tones)).thenReturn(true);
         when(mToneProxy.isPresent()).thenReturn(true);
@@ -55,6 +61,7 @@
     }
 
     @SmallTest
+    @Test
     public void testUnsupportedStart() {
         when(mContext.getResources().getBoolean(R.bool.allow_local_dtmf_tones)).thenReturn(false);
         when(mToneProxy.isPresent()).thenReturn(true);
@@ -64,6 +71,7 @@
     }
 
     @SmallTest
+    @Test
     public void testPlayToneWhenUninitialized() {
         when(mContext.getResources().getBoolean(R.bool.allow_local_dtmf_tones)).thenReturn(false);
         when(mToneProxy.isPresent()).thenReturn(false);
@@ -74,6 +82,7 @@
     }
 
     @SmallTest
+    @Test
     public void testPlayToneWhenInitialized() {
         when(mContext.getResources().getBoolean(R.bool.allow_local_dtmf_tones)).thenReturn(true);
         when(mToneProxy.isPresent()).thenReturn(true);
@@ -84,6 +93,7 @@
     }
 
     @SmallTest
+    @Test
     public void testStopToneWhenUninitialized() {
         when(mContext.getResources().getBoolean(R.bool.allow_local_dtmf_tones)).thenReturn(false);
         when(mToneProxy.isPresent()).thenReturn(false);
@@ -94,6 +104,7 @@
     }
 
     @SmallTest
+    @Test
     public void testStopToneWhenInitialized() {
         when(mContext.getResources().getBoolean(R.bool.allow_local_dtmf_tones)).thenReturn(true);
         when(mToneProxy.isPresent()).thenReturn(true);
@@ -104,6 +115,7 @@
     }
 
     @SmallTest
+    @Test
     public void testProperTeardown() {
         when(mContext.getResources().getBoolean(R.bool.allow_local_dtmf_tones)).thenReturn(true);
         when(mToneProxy.isPresent()).thenReturn(true);
diff --git a/tests/src/com/android/server/telecom/tests/EventManagerTest.java b/tests/src/com/android/server/telecom/tests/EventManagerTest.java
index bb07306..24394ec 100644
--- a/tests/src/com/android/server/telecom/tests/EventManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/EventManagerTest.java
@@ -19,14 +19,25 @@
 import android.telecom.Logging.EventManager;
 import android.test.suitebuilder.annotation.SmallTest;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
 import java.util.List;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.stream.Collectors;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 /**
  * Unit tests for android.telecom.Logging.EventManager.
  */
-
+@RunWith(JUnit4.class)
 public class EventManagerTest extends TelecomTestCase {
 
     private EventManager mTestEventManager;
@@ -60,6 +71,7 @@
     }
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         mTestEventManager = new EventManager(() -> "");
@@ -67,6 +79,7 @@
     }
 
     @Override
+    @After
     public void tearDown() throws Exception {
         mTestEventManager = null;
         mAddedEventRecord = null;
@@ -78,6 +91,7 @@
      * the eventRecordAdded callback is working.
      */
     @SmallTest
+    @Test
     public void testAddEventRecord() throws Exception {
         TestRecord testRecord = new TestRecord("testId", "testDescription");
         mTestEventManager.event(testRecord, TEST_EVENT, null);
@@ -94,6 +108,7 @@
      * the oldest entry is dropped.
      */
     @SmallTest
+    @Test
     public void testAddEventRecordOverflowMaxEvents() throws Exception {
         TestRecord oldestRecordEntry = new TestRecord("id0", "desc0");
         // Add the oldest record separately so that we can verify it is dropped later
@@ -119,6 +134,7 @@
      * If the queue is resized to be smaller, the oldest records are dropped.
      */
     @SmallTest
+    @Test
     public void testChangeQueueSize() throws Exception {
         TestRecord oldestRecordEntry = new TestRecord("id0", "desc0");
         // Add the oldest record separately so that we can verify it is dropped later
@@ -151,6 +167,7 @@
      * timing response is correct.
      */
     @SmallTest
+    @Test
     public void testExtractEventTimings() throws Exception {
         TestRecord testRecord = new TestRecord("testId", "testDesc");
         // Add unassociated event
@@ -179,6 +196,7 @@
      * Verify that adding events to different records does not create a valid TimedEventPair
      */
     @SmallTest
+    @Test
     public void testExtractEventTimingsDifferentRecords() throws Exception {
         TestRecord testRecord = new TestRecord("testId", "testDesc");
         TestRecord testRecord2 = new TestRecord("testId2", "testDesc2");
diff --git a/tests/src/com/android/server/telecom/tests/InCallControllerTests.java b/tests/src/com/android/server/telecom/tests/InCallControllerTests.java
index 0c6d3c7..0671a4e 100644
--- a/tests/src/com/android/server/telecom/tests/InCallControllerTests.java
+++ b/tests/src/com/android/server/telecom/tests/InCallControllerTests.java
@@ -54,6 +54,11 @@
 import com.android.server.telecom.TelecomSystem;
 import com.android.server.telecom.Timeouts;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
@@ -63,6 +68,8 @@
 import java.util.Collections;
 import java.util.LinkedList;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
 import static org.mockito.ArgumentMatchers.nullable;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyInt;
@@ -76,6 +83,7 @@
 import static org.mockito.Mockito.when;
 import static org.mockito.Mockito.verify;
 
+@RunWith(JUnit4.class)
 public class InCallControllerTests extends TelecomTestCase {
     @Mock CallsManager mMockCallsManager;
     @Mock PhoneAccountRegistrar mMockPhoneAccountRegistrar;
@@ -102,6 +110,7 @@
     private EmergencyCallHelper mEmergencyCallHelper;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         MockitoAnnotations.initMocks(this);
@@ -118,11 +127,13 @@
     }
 
     @Override
+    @After
     public void tearDown() throws Exception {
         super.tearDown();
     }
 
     @MediumTest
+    @Test
     public void testBindToService_NoServicesFound_IncomingCall() throws Exception {
         when(mMockCallsManager.getCurrentUserHandle()).thenReturn(mUserHandle);
         when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager);
@@ -150,6 +161,7 @@
     }
 
     @MediumTest
+    @Test
     public void testBindToService_NoServicesFound_OutgoingCall() throws Exception {
         Bundle callExtras = new Bundle();
         callExtras.putBoolean("whatever", true);
@@ -186,6 +198,7 @@
     }
 
     @MediumTest
+    @Test
     public void testBindToService_DefaultDialer_NoEmergency() throws Exception {
         Bundle callExtras = new Bundle();
         callExtras.putBoolean("whatever", true);
@@ -236,6 +249,7 @@
     }
 
     @MediumTest
+    @Test
     public void testBindToService_SystemDialer_Emergency() throws Exception {
         Bundle callExtras = new Bundle();
         callExtras.putBoolean("whatever", true);
@@ -303,6 +317,7 @@
     }
 
     @MediumTest
+    @Test
     public void testBindToService_DefaultDialer_FallBackToSystem() throws Exception {
         Bundle callExtras = new Bundle();
         callExtras.putBoolean("whatever", true);
@@ -391,6 +406,7 @@
      * supports external calls.
      */
     @MediumTest
+    @Test
     public void testBindToService_IncludeExternal() throws Exception {
         setupMocks(true /* isExternalCall */);
         setupMockPackageManager(true /* default */, true /* system */, true /* external calls */);
@@ -427,6 +443,7 @@
      * call gets connected soon after, the new call will still be sent to the in-call service.
      */
     @MediumTest
+    @Test
     public void testUnbindDueToCallDisconnect() throws Exception {
         when(mMockCallsManager.getCurrentUserHandle()).thenReturn(mUserHandle);
         when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager);
diff --git a/tests/src/com/android/server/telecom/tests/InCallWakeLockControllerTest.java b/tests/src/com/android/server/telecom/tests/InCallWakeLockControllerTest.java
index 3a8c2d9..fd581f3 100644
--- a/tests/src/com/android/server/telecom/tests/InCallWakeLockControllerTest.java
+++ b/tests/src/com/android/server/telecom/tests/InCallWakeLockControllerTest.java
@@ -30,8 +30,14 @@
 import com.android.server.telecom.InCallWakeLockController;
 import com.android.server.telecom.TelecomWakeLock;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.Mock;
 
+@RunWith(JUnit4.class)
 public class InCallWakeLockControllerTest extends TelecomTestCase {
 
     @Mock CallsManager mCallsManager;
@@ -40,6 +46,7 @@
     private InCallWakeLockController mInCallWakeLockController;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         TelecomWakeLock telecomWakeLock = new TelecomWakeLock(
@@ -50,12 +57,14 @@
     }
 
     @Override
+    @After
     public void tearDown() throws Exception {
         mInCallWakeLockController = null;
         super.tearDown();
     }
 
     @SmallTest
+    @Test
     public void testRingingCallAdded() throws Exception {
         when(mCallsManager.getRingingCall()).thenReturn(mCall);
         when(mWakeLockAdapter.isHeld()).thenReturn(false);
@@ -66,6 +75,7 @@
     }
 
     @SmallTest
+    @Test
     public void testNonRingingCallAdded() throws Exception {
         when(mCallsManager.getRingingCall()).thenReturn(null);
         when(mWakeLockAdapter.isHeld()).thenReturn(false);
@@ -76,6 +86,7 @@
     }
 
     @SmallTest
+    @Test
     public void testRingingCallTransition() throws Exception {
         when(mCallsManager.getRingingCall()).thenReturn(mCall);
         when(mWakeLockAdapter.isHeld()).thenReturn(false);
@@ -86,6 +97,7 @@
     }
 
     @SmallTest
+    @Test
     public void testRingingCallRemoved() throws Exception {
         when(mCallsManager.getRingingCall()).thenReturn(null);
         when(mWakeLockAdapter.isHeld()).thenReturn(false);
@@ -96,6 +108,7 @@
     }
 
     @SmallTest
+    @Test
     public void testWakeLockReleased() throws Exception {
         when(mCallsManager.getRingingCall()).thenReturn(null);
         when(mWakeLockAdapter.isHeld()).thenReturn(true);
@@ -106,6 +119,7 @@
     }
 
     @SmallTest
+    @Test
     public void testAcquireWakeLockWhenHeld() throws Exception {
         when(mCallsManager.getRingingCall()).thenReturn(mCall);
         when(mWakeLockAdapter.isHeld()).thenReturn(true);
diff --git a/tests/src/com/android/server/telecom/tests/IncomingCallFilterTest.java b/tests/src/com/android/server/telecom/tests/IncomingCallFilterTest.java
index 6861ad5..d975ec2 100644
--- a/tests/src/com/android/server/telecom/tests/IncomingCallFilterTest.java
+++ b/tests/src/com/android/server/telecom/tests/IncomingCallFilterTest.java
@@ -28,12 +28,17 @@
 import com.android.server.telecom.callfiltering.IncomingCallFilter;
 import com.android.server.telecom.TelecomSystem;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.Mock;
 
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
+import static org.junit.Assert.assertEquals;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.atMost;
@@ -41,6 +46,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class IncomingCallFilterTest extends TelecomTestCase {
     @Mock private CallFilterResultCallback mResultCallback;
     @Mock private Call mCall;
@@ -82,6 +88,8 @@
 
     private static final CallFilteringResult DEFAULT_RESULT = RESULT1;
 
+    @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         mContext = mComponentContextFixture.getTestDouble().getApplicationContext();
@@ -90,6 +98,7 @@
     }
 
     @SmallTest
+    @Test
     public void testSingleFilter() {
         IncomingCallFilter testFilter = new IncomingCallFilter(mContext, mResultCallback, mCall,
                 mLock, mTimeoutsAdapter, Collections.singletonList(mFilter1));
@@ -102,6 +111,7 @@
     }
 
     @SmallTest
+    @Test
     public void testMultipleFilters() {
         List<IncomingCallFilter.CallFilter> filters =
                 new ArrayList<IncomingCallFilter.CallFilter>() {{
@@ -130,6 +140,7 @@
     }
 
     @SmallTest
+    @Test
     public void testFilterTimeout() throws Exception {
         setTimeoutLength(SHORT_TIMEOUT);
         IncomingCallFilter testFilter = new IncomingCallFilter(mContext, mResultCallback, mCall,
@@ -145,6 +156,7 @@
     }
 
     @SmallTest
+    @Test
     public void testFilterTimeoutDoesntTrip() throws Exception {
         setTimeoutLength(SHORT_TIMEOUT);
         IncomingCallFilter testFilter = new IncomingCallFilter(mContext, mResultCallback, mCall,
@@ -158,6 +170,7 @@
     }
 
     @SmallTest
+    @Test
     public void testToString() {
         assertEquals("[Allow, logged, notified]", RESULT1.toString());
         assertEquals("[Reject, notified]", RESULT2.toString());
diff --git a/tests/src/com/android/server/telecom/tests/IncomingCallNotifierTest.java b/tests/src/com/android/server/telecom/tests/IncomingCallNotifierTest.java
index 1909259..6419bba 100644
--- a/tests/src/com/android/server/telecom/tests/IncomingCallNotifierTest.java
+++ b/tests/src/com/android/server/telecom/tests/IncomingCallNotifierTest.java
@@ -28,6 +28,10 @@
 import com.android.server.telecom.HandoverState;
 import com.android.server.telecom.ui.IncomingCallNotifier;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.Mock;
 
 import static org.mockito.Matchers.any;
@@ -41,6 +45,7 @@
 /**
  * Tests for the {@link com.android.server.telecom.ui.IncomingCallNotifier} class.
  */
+@RunWith(JUnit4.class)
 public class IncomingCallNotifierTest extends TelecomTestCase {
 
     @Mock private IncomingCallNotifier.CallsManagerProxy mCallsManagerProxy;
@@ -50,6 +55,8 @@
     private IncomingCallNotifier mIncomingCallNotifier;
     private NotificationManager mNotificationManager;
 
+    @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         mContext = mComponentContextFixture.getTestDouble().getApplicationContext();
@@ -78,6 +85,7 @@
      * Add a call that isn't ringing.
      */
     @SmallTest
+    @Test
     public void testSingleCall() {
         mIncomingCallNotifier.onCallAdded(mAudioCall);
         verify(mNotificationManager, never()).notify(eq(IncomingCallNotifier.NOTIFICATION_TAG),
@@ -88,6 +96,7 @@
      * Add a ringing call when there is no other ongoing call.
      */
     @SmallTest
+    @Test
     public void testIncomingDuringOngoingCall() {
         when(mCallsManagerProxy.hasCallsForOtherPhoneAccount(any())).thenReturn(false);
         mIncomingCallNotifier.onCallAdded(mRingingCall);
@@ -99,6 +108,7 @@
      * Add a ringing call with another call ongoing, not from a different phone account.
      */
     @SmallTest
+    @Test
     public void testIncomingDuringOngoingCall2() {
         when(mCallsManagerProxy.hasCallsForOtherPhoneAccount(any())).thenReturn(false);
         when(mCallsManagerProxy.getNumCallsForOtherPhoneAccount(any())).thenReturn(0);
@@ -114,6 +124,7 @@
      * Remove ringing call with another call ongoing.
      */
     @SmallTest
+    @Test
     public void testCallRemoved() {
         when(mCallsManagerProxy.hasCallsForOtherPhoneAccount(any())).thenReturn(true);
         when(mCallsManagerProxy.getNumCallsForOtherPhoneAccount(any())).thenReturn(1);
@@ -132,6 +143,7 @@
      * Ensure notification doesn't show during handover.
      */
     @SmallTest
+    @Test
     public void testDontShowDuringHandover1() {
         when(mCallsManagerProxy.hasCallsForOtherPhoneAccount(any())).thenReturn(true);
         when(mCallsManagerProxy.getNumCallsForOtherPhoneAccount(any())).thenReturn(1);
@@ -150,6 +162,7 @@
      * Ensure notification doesn't show during handover.
      */
     @SmallTest
+    @Test
     public void testDontShowDuringHandover2() {
         when(mCallsManagerProxy.hasCallsForOtherPhoneAccount(any())).thenReturn(true);
         when(mCallsManagerProxy.getNumCallsForOtherPhoneAccount(any())).thenReturn(1);
diff --git a/tests/src/com/android/server/telecom/tests/MissedCallNotifierImplTest.java b/tests/src/com/android/server/telecom/tests/MissedCallNotifierImplTest.java
index 950cb2c..a3bdb10 100644
--- a/tests/src/com/android/server/telecom/tests/MissedCallNotifierImplTest.java
+++ b/tests/src/com/android/server/telecom/tests/MissedCallNotifierImplTest.java
@@ -51,6 +51,11 @@
 import com.android.server.telecom.ui.MissedCallNotifierImpl;
 import com.android.server.telecom.ui.MissedCallNotifierImpl.NotificationBuilderFactory;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
@@ -60,6 +65,8 @@
 import java.util.LinkedList;
 import java.util.List;
 
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 import static org.mockito.ArgumentMatchers.nullable;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyString;
@@ -74,6 +81,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class MissedCallNotifierImplTest extends TelecomTestCase {
 
     private static class MockMissedCallCursorBuilder {
@@ -149,6 +157,7 @@
     @Mock private DefaultDialerCache mDefaultDialerCache;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         MockitoAnnotations.initMocks(this);
@@ -174,17 +183,20 @@
     }
 
     @Override
+    @After
     public void tearDown() throws Exception {
         TelecomSystem.setInstance(null);
         when(mTelecomSystem.isBootComplete()).thenReturn(false);
     }
 
     @SmallTest
+    @Test
     public void testCancelNotificationInPrimaryUser() {
         cancelNotificationTestInternal(PRIMARY_USER);
     }
 
     @SmallTest
+    @Test
     public void testCancelNotificationInSecondaryUser() {
         cancelNotificationTestInternal(SECONARY_USER);
     }
@@ -217,6 +229,7 @@
     }
 
     @SmallTest
+    @Test
     public void testNotifyMultipleMissedCalls() {
         Notification.Builder[] builders = new Notification.Builder[4];
 
@@ -280,18 +293,21 @@
     }
 
     @SmallTest
+    @Test
     public void testNotifySingleCallInPrimaryUser() {
         PhoneAccount phoneAccount = makePhoneAccount(PRIMARY_USER, NO_CAPABILITY);
         notifySingleCallTestInternal(phoneAccount, PRIMARY_USER);
     }
 
     @SmallTest
+    @Test
     public void testNotifySingleCallInSecondaryUser() {
         PhoneAccount phoneAccount = makePhoneAccount(SECONARY_USER, NO_CAPABILITY);
         notifySingleCallTestInternal(phoneAccount, PRIMARY_USER);
     }
 
     @SmallTest
+    @Test
     public void testNotifySingleCallInSecondaryUserWithMultiUserCapability() {
         PhoneAccount phoneAccount = makePhoneAccount(PRIMARY_USER,
                 PhoneAccount.CAPABILITY_MULTI_USER);
@@ -299,12 +315,14 @@
     }
 
     @SmallTest
+    @Test
     public void testNotifySingleCallWhenCurrentUserIsSecondaryUser() {
         PhoneAccount phoneAccount = makePhoneAccount(PRIMARY_USER, NO_CAPABILITY);
         notifySingleCallTestInternal(phoneAccount, SECONARY_USER);
     }
 
     @SmallTest
+    @Test
     public void testNotifySingleCall() {
         PhoneAccount phoneAccount = makePhoneAccount(PRIMARY_USER, NO_CAPABILITY);
         notifySingleCallTestInternal(phoneAccount, PRIMARY_USER);
@@ -375,6 +393,7 @@
     }
 
     @SmallTest
+    @Test
     public void testNoSmsBackAfterMissedSipCall() {
         Notification.Builder builder1 = makeNotificationBuilder("builder1");
         MissedCallNotifierImpl.NotificationBuilderFactory fakeBuilderFactory =
@@ -410,6 +429,7 @@
     }
 
     @SmallTest
+    @Test
     public void testLoadOneCallFromDb() throws Exception {
         CallerInfoLookupHelper mockCallerInfoLookupHelper = mock(CallerInfoLookupHelper.class);
         MissedCallNotifier.CallInfoFactory mockCallInfoFactory =
@@ -474,6 +494,7 @@
     }
 
     @SmallTest
+    @Test
     public void testLoadTwoCallsFromDb() throws Exception {
         TelecomSystem.setInstance(mTelecomSystem);
         when(mTelecomSystem.isBootComplete()).thenReturn(true);
diff --git a/tests/src/com/android/server/telecom/tests/NewOutgoingCallIntentBroadcasterTest.java b/tests/src/com/android/server/telecom/tests/NewOutgoingCallIntentBroadcasterTest.java
index ad262f1..4c0e76a 100644
--- a/tests/src/com/android/server/telecom/tests/NewOutgoingCallIntentBroadcasterTest.java
+++ b/tests/src/com/android/server/telecom/tests/NewOutgoingCallIntentBroadcasterTest.java
@@ -40,9 +40,16 @@
 import com.android.server.telecom.PhoneNumberUtilsAdapterImpl;
 import com.android.server.telecom.TelecomSystem;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.nullable;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyBoolean;
@@ -57,6 +64,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class NewOutgoingCallIntentBroadcasterTest extends TelecomTestCase {
     private static class ReceiverIntentPair {
         public BroadcastReceiver receiver;
@@ -74,6 +82,7 @@
     private PhoneNumberUtilsAdapter mPhoneNumberUtilsAdapterSpy;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         mContext = mComponentContextFixture.getTestDouble().getApplicationContext();
@@ -83,6 +92,7 @@
     }
 
     @SmallTest
+    @Test
     public void testNullHandle() {
         Intent intent = new Intent(Intent.ACTION_CALL, null);
         int result = processIntent(intent, true);
@@ -92,6 +102,7 @@
     }
 
     @SmallTest
+    @Test
     public void testVoicemailCall() {
         String voicemailNumber = "voicemail:18005551234";
         Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(voicemailNumber));
@@ -105,16 +116,19 @@
     }
 
     @SmallTest
+    @Test
     public void testVoicemailCallWithBadAction() {
         badCallActionHelper(Uri.parse("voicemail:18005551234"), DisconnectCause.OUTGOING_CANCELED);
     }
 
     @SmallTest
+    @Test
     public void testTelCallWithBadCallAction() {
         badCallActionHelper(Uri.parse("tel:6505551234"), DisconnectCause.INVALID_NUMBER);
     }
 
     @SmallTest
+    @Test
     public void testSipCallWithBadCallAction() {
         badCallActionHelper(Uri.parse("sip:testuser@testsite.com"), DisconnectCause.INVALID_NUMBER);
     }
@@ -130,6 +144,7 @@
     }
 
     @SmallTest
+    @Test
     public void testAlreadyDisconnectedCall() {
         Uri handle = Uri.parse("tel:6505551234");
         doReturn(true).when(mCall).isDisconnected();
@@ -144,6 +159,7 @@
     }
 
     @SmallTest
+    @Test
     public void testNoNumberSupplied() {
         Uri handle = Uri.parse("tel:");
         Intent intent = new Intent(Intent.ACTION_CALL, handle);
@@ -156,6 +172,7 @@
     }
 
     @SmallTest
+    @Test
     public void testEmergencyCallWithNonDefaultDialer() {
         Uri handle = Uri.parse("tel:6505551911");
         doReturn(true).when(mPhoneNumberUtilsAdapterSpy).isPotentialLocalEmergencyNumber(
@@ -185,6 +202,7 @@
     }
 
     @SmallTest
+    @Test
     public void testActionCallEmergencyCall() {
         Uri handle = Uri.parse("tel:6505551911");
         Intent intent = buildIntent(handle, Intent.ACTION_CALL, null);
@@ -192,6 +210,7 @@
     }
 
     @SmallTest
+    @Test
     public void testActionEmergencyWithEmergencyNumber() {
         Uri handle = Uri.parse("tel:6505551911");
         Intent intent = buildIntent(handle, Intent.ACTION_CALL_EMERGENCY, null);
@@ -199,6 +218,7 @@
     }
 
     @SmallTest
+    @Test
     public void testActionPrivCallWithEmergencyNumber() {
         Uri handle = Uri.parse("tel:6505551911");
         Intent intent = buildIntent(handle, Intent.ACTION_CALL_PRIVILEGED, null);
@@ -206,6 +226,7 @@
     }
 
     @SmallTest
+    @Test
     public void testEmergencyCallWithGatewayExtras() {
         Uri handle = Uri.parse("tel:6505551911");
         Bundle gatewayExtras = new Bundle();
@@ -218,6 +239,7 @@
     }
 
     @SmallTest
+    @Test
     public void testActionEmergencyWithNonEmergencyNumber() {
         Uri handle = Uri.parse("tel:6505551911");
         doReturn(false).when(mPhoneNumberUtilsAdapterSpy).isPotentialLocalEmergencyNumber(
@@ -254,6 +276,7 @@
     }
 
     @SmallTest
+    @Test
     public void testUnmodifiedRegularCall() {
         Uri handle = Uri.parse("tel:6505551234");
         Intent callIntent = buildIntent(handle, Intent.ACTION_CALL, null);
@@ -269,6 +292,7 @@
     }
 
     @SmallTest
+    @Test
     public void testUnmodifiedSipCall() {
         Uri handle = Uri.parse("sip:test@test.com");
         Intent callIntent = buildIntent(handle, Intent.ACTION_CALL, null);
@@ -286,6 +310,7 @@
     }
 
     @SmallTest
+    @Test
     public void testCallWithGatewayInfo() {
         Uri handle = Uri.parse("tel:6505551234");
         Intent callIntent = buildIntent(handle, Intent.ACTION_CALL, null);
@@ -305,6 +330,7 @@
     }
 
     @SmallTest
+    @Test
     public void testCallNumberModifiedToNull() {
         Uri handle = Uri.parse("tel:6505551234");
         Intent callIntent = buildIntent(handle, Intent.ACTION_CALL, null);
@@ -320,6 +346,7 @@
     }
 
     @SmallTest
+    @Test
     public void testCallNumberModifiedToNullWithLongCustomTimeout() {
         Uri handle = Uri.parse("tel:6505551234");
         Intent callIntent = buildIntent(handle, Intent.ACTION_CALL, null);
@@ -339,6 +366,7 @@
     }
 
     @SmallTest
+    @Test
     public void testCallModifiedToEmergency() {
         Uri handle = Uri.parse("tel:6505551234");
         Intent callIntent = buildIntent(handle, Intent.ACTION_CALL, null);
diff --git a/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java b/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java
index 6403d03..7d9cf88 100644
--- a/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java
+++ b/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java
@@ -26,6 +26,8 @@
 import android.os.Parcel;
 import android.os.Process;
 import android.os.UserHandle;
+import android.os.UserManager;
+import android.support.test.InstrumentationRegistry;
 import android.telecom.Log;
 import android.telecom.PhoneAccount;
 import android.telecom.PhoneAccountHandle;
@@ -39,6 +41,11 @@
 import com.android.server.telecom.PhoneAccountRegistrar;
 import com.android.server.telecom.PhoneAccountRegistrar.DefaultPhoneAccountHandle;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
@@ -54,10 +61,17 @@
 import java.util.List;
 import java.util.Set;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 import static org.mockito.Matchers.anyInt;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class PhoneAccountRegistrarTest extends TelecomTestCase {
 
     private static final int MAX_VERSION = Integer.MAX_VALUE;
@@ -69,6 +83,7 @@
     @Mock private PhoneAccountRegistrar.AppLabelProxy mAppLabelProxy;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         MockitoAnnotations.initMocks(this);
@@ -87,6 +102,7 @@
     }
 
     @Override
+    @After
     public void tearDown() throws Exception {
         mRegistrar = null;
         new File(
@@ -97,6 +113,7 @@
     }
 
     @MediumTest
+    @Test
     public void testPhoneAccountHandle() throws Exception {
         PhoneAccountHandle input = new PhoneAccountHandle(new ComponentName("pkg0", "cls0"), "id0");
         PhoneAccountHandle result = roundTripXml(this, input,
@@ -111,6 +128,7 @@
     }
 
     @MediumTest
+    @Test
     public void testPhoneAccount() throws Exception {
         Bundle testBundle = new Bundle();
         testBundle.putInt("EXTRA_INT_1", 1);
@@ -133,9 +151,14 @@
     }
 
     @MediumTest
+    @Test
     public void testDefaultPhoneAccountHandleEmptyGroup() throws Exception {
         DefaultPhoneAccountHandle input = new DefaultPhoneAccountHandle(Process.myUserHandle(),
                 makeQuickAccountHandle("i1"), "");
+        when(UserManager.get(mContext).getSerialNumberForUser(input.userHandle))
+                .thenReturn(0L);
+        when(UserManager.get(mContext).getUserForSerialNumber(0L))
+                .thenReturn(input.userHandle);
         DefaultPhoneAccountHandle result = roundTripXml(this, input,
                 PhoneAccountRegistrar.sDefaultPhoneAcountHandleXml, mContext);
 
@@ -147,6 +170,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testPhoneAccountExtrasEdge() throws Exception {
         Bundle testBundle = new Bundle();
         // Ensure null values for string are not persisted.
@@ -176,6 +200,7 @@
     }
 
     @MediumTest
+    @Test
     public void testState() throws Exception {
         PhoneAccountRegistrar.State input = makeQuickState();
         PhoneAccountRegistrar.State result = roundTripXml(this, input,
@@ -190,6 +215,7 @@
     }
 
     @MediumTest
+    @Test
     public void testAccounts() throws Exception {
         int i = 0;
 
@@ -220,11 +246,13 @@
     }
 
     @MediumTest
+    @Test
     public void testSimCallManager() throws Exception {
         // TODO
     }
 
     @MediumTest
+    @Test
     public void testDefaultOutgoing() throws Exception {
         mComponentContextFixture.addConnectionService(makeQuickConnectionServiceComponentName(),
                 Mockito.mock(IConnectionService.class));
@@ -273,6 +301,7 @@
     }
 
     @MediumTest
+    @Test
     public void testReplacePhoneAccountByGroup() throws Exception {
         mComponentContextFixture.addConnectionService(makeQuickConnectionServiceComponentName(),
                 Mockito.mock(IConnectionService.class));
@@ -317,6 +346,7 @@
     }
 
     @MediumTest
+    @Test
     public void testAddSameDefault() throws Exception {
         mComponentContextFixture.addConnectionService(makeQuickConnectionServiceComponentName(),
                 Mockito.mock(IConnectionService.class));
@@ -361,6 +391,7 @@
     }
 
     @MediumTest
+    @Test
     public void testAddSameGroup() throws Exception {
         mComponentContextFixture.addConnectionService(makeQuickConnectionServiceComponentName(),
                 Mockito.mock(IConnectionService.class));
@@ -406,6 +437,7 @@
     }
 
     @MediumTest
+    @Test
     public void testAddSameGroupButDifferentComponent() throws Exception {
         mComponentContextFixture.addConnectionService(makeQuickConnectionServiceComponentName(),
                 Mockito.mock(IConnectionService.class));
@@ -444,6 +476,7 @@
     }
 
     @MediumTest
+    @Test
     public void testAddSameGroupButDifferentComponent2() throws Exception {
         mComponentContextFixture.addConnectionService(makeQuickConnectionServiceComponentName(),
                 Mockito.mock(IConnectionService.class));
@@ -496,6 +529,7 @@
     }
 
     @MediumTest
+    @Test
     public void testPhoneAccountParceling() throws Exception {
         PhoneAccountHandle handle = makeQuickAccountHandle("foo");
         roundTripPhoneAccount(new PhoneAccount.Builder(handle, null).build());
@@ -520,7 +554,7 @@
                         .setHighlightColor(0xf0f0f0)
                         .setIcon(Icon.createWithBitmap(
                                 BitmapFactory.decodeResource(
-                                        getContext().getResources(),
+                                        InstrumentationRegistry.getContext().getResources(),
                                         R.drawable.stat_sys_phone_call)))
                         .setShortDescription("short description")
                         .setSubscriptionAddress(Uri.parse("tel:2345678"))
@@ -535,6 +569,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testSelfManagedPhoneAccount() throws Exception {
         mComponentContextFixture.addConnectionService(makeQuickConnectionServiceComponentName(),
                 Mockito.mock(IConnectionService.class));
@@ -558,6 +593,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testSelfManagedCapabilityOverride() throws Exception {
         mComponentContextFixture.addConnectionService(makeQuickConnectionServiceComponentName(),
                 Mockito.mock(IConnectionService.class));
@@ -579,6 +615,7 @@
     }
 
     @MediumTest
+    @Test
     public void testSortSimFirst() throws Exception {
         ComponentName componentA = new ComponentName("a", "a");
         ComponentName componentB = new ComponentName("b", "b");
@@ -609,6 +646,7 @@
     }
 
     @MediumTest
+    @Test
     public void testSortBySortOrder() throws Exception {
         ComponentName componentA = new ComponentName("a", "a");
         ComponentName componentB = new ComponentName("b", "b");
@@ -648,6 +686,7 @@
     }
 
     @MediumTest
+    @Test
     public void testSortByLabel() throws Exception {
         ComponentName componentA = new ComponentName("a", "a");
         ComponentName componentB = new ComponentName("b", "b");
@@ -685,6 +724,7 @@
     }
 
     @MediumTest
+    @Test
     public void testSortAll() throws Exception {
         ComponentName componentA = new ComponentName("a", "a");
         ComponentName componentB = new ComponentName("b", "b");
@@ -770,6 +810,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testGetByEnabledState() throws Exception {
         mComponentContextFixture.addConnectionService(makeQuickConnectionServiceComponentName(),
                 Mockito.mock(IConnectionService.class));
@@ -789,6 +830,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testGetByScheme() throws Exception {
         mComponentContextFixture.addConnectionService(makeQuickConnectionServiceComponentName(),
                 Mockito.mock(IConnectionService.class));
@@ -815,6 +857,7 @@
      * @throws Exception
      */
     @MediumTest
+    @Test
     public void testGetByCapability() throws Exception {
         mComponentContextFixture.addConnectionService(makeQuickConnectionServiceComponentName(),
                 Mockito.mock(IConnectionService.class));
@@ -1011,6 +1054,10 @@
         PhoneAccountHandle phoneAccountHandle = new PhoneAccountHandle(
                 new ComponentName("pkg0", "cls0"), "id0");
         UserHandle userHandle = phoneAccountHandle.getUserHandle();
+        when(UserManager.get(mContext).getSerialNumberForUser(userHandle))
+                .thenReturn(0L);
+        when(UserManager.get(mContext).getUserForSerialNumber(0L))
+                .thenReturn(userHandle);
         s.defaultOutgoingAccountHandles
                 .put(userHandle, new DefaultPhoneAccountHandle(userHandle, phoneAccountHandle,
                         "testGroup"));
diff --git a/tests/src/com/android/server/telecom/tests/ProximitySensorManagerTest.java b/tests/src/com/android/server/telecom/tests/ProximitySensorManagerTest.java
index 01bd09e..eafaa53 100644
--- a/tests/src/com/android/server/telecom/tests/ProximitySensorManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/ProximitySensorManagerTest.java
@@ -24,6 +24,11 @@
 import com.android.server.telecom.ProximitySensorManager;
 import com.android.server.telecom.TelecomWakeLock;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.Mock;
 
 import java.util.ArrayList;
@@ -33,6 +38,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class ProximitySensorManagerTest extends TelecomTestCase{
 
     @Mock CallsManager mCallsManager;
@@ -41,6 +47,7 @@
     private ProximitySensorManager mProximitySensorManager;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         TelecomWakeLock telecomWakeLock = new TelecomWakeLock(
@@ -51,12 +58,14 @@
     }
 
     @Override
+    @After
     public void tearDown() throws Exception {
         mProximitySensorManager = null;
         super.tearDown();
     }
 
     @SmallTest
+    @Test
     public void testTurnOnProximityWithCallsActive() throws Exception {
         when(mCallsManager.getCalls()).thenReturn(new ArrayList<Call>(){{
             add(mCall);
@@ -69,6 +78,7 @@
     }
 
     @SmallTest
+    @Test
     public void testTurnOnProximityWithNoCallsActive() throws Exception {
         when(mCallsManager.getCalls()).thenReturn(new ArrayList<Call>());
         when(mWakeLockAdapter.isHeld()).thenReturn(false);
@@ -80,6 +90,7 @@
     }
 
     @SmallTest
+    @Test
     public void testTurnOffProximityExplicitly() throws Exception {
         when(mWakeLockAdapter.isHeld()).thenReturn(true);
 
@@ -89,6 +100,7 @@
     }
 
     @SmallTest
+    @Test
     public void testCallRemovedFromCallsManagerCallsActive() throws Exception {
         when(mCallsManager.getCalls()).thenReturn(new ArrayList<Call>(){{
             add(mCall);
@@ -101,6 +113,7 @@
     }
 
     @SmallTest
+    @Test
     public void testCallRemovedFromCallsManagerNoCallsActive() throws Exception {
         when(mCallsManager.getCalls()).thenReturn(new ArrayList<Call>());
         when(mWakeLockAdapter.isHeld()).thenReturn(true);
diff --git a/tests/src/com/android/server/telecom/tests/RingerTest.java b/tests/src/com/android/server/telecom/tests/RingerTest.java
index 2953fce..47ac174 100644
--- a/tests/src/com/android/server/telecom/tests/RingerTest.java
+++ b/tests/src/com/android/server/telecom/tests/RingerTest.java
@@ -34,8 +34,14 @@
 import com.android.server.telecom.RingtoneFactory;
 import com.android.server.telecom.SystemSettingsUtil;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.Mock;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.Mockito.mock;
@@ -43,6 +49,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class RingerTest extends TelecomTestCase {
     @Mock InCallTonePlayer.Factory mockPlayerFactory;
     @Mock SystemSettingsUtil mockSystemSettingsUtil;
@@ -57,6 +64,9 @@
 
     Ringer mRingerUnderTest;
     AudioManager mockAudioManager;
+
+    @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         mContext = mComponentContextFixture.getTestDouble().getApplicationContext();
@@ -72,6 +82,7 @@
     }
 
     @SmallTest
+    @Test
     public void testNoActionInTheaterMode() {
         // Start call waiting to make sure that it doesn't stop when we start ringing
         mRingerUnderTest.startCallWaiting(mockCall1);
@@ -84,6 +95,7 @@
     }
 
     @SmallTest
+    @Test
     public void testNoActionWhenDialerRings() {
         // Start call waiting to make sure that it doesn't stop when we start ringing
         mRingerUnderTest.startCallWaiting(mockCall1);
@@ -96,6 +108,7 @@
     }
 
     @SmallTest
+    @Test
     public void testAudioFocusStillAcquiredWhenDialerRings() {
         // Start call waiting to make sure that it doesn't stop when we start ringing
         mRingerUnderTest.startCallWaiting(mockCall1);
@@ -109,6 +122,7 @@
     }
 
     @SmallTest
+    @Test
     public void testNoActionWhenCallIsSelfManaged() {
         // Start call waiting to make sure that it doesn't stop when we start ringing
         mRingerUnderTest.startCallWaiting(mockCall1);
@@ -122,6 +136,7 @@
     }
 
     @SmallTest
+    @Test
     public void testCallWaitingButNoRingForSpecificContacts() {
         NotificationManager notificationManager =
                 (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
@@ -138,6 +153,7 @@
     }
 
     @SmallTest
+    @Test
     public void testVibrateButNoRingForNullRingtone() {
         mRingerUnderTest.startCallWaiting(mockCall1);
         when(mockRingtoneFactory.getRingtone(any(Call.class))).thenReturn(null);
@@ -150,6 +166,7 @@
     }
 
     @SmallTest
+    @Test
     public void testVibrateButNoRingForSilentRingtone() {
         mRingerUnderTest.startCallWaiting(mockCall1);
         Ringtone mockRingtone = mock(Ringtone.class);
@@ -164,6 +181,7 @@
     }
 
     @SmallTest
+    @Test
     public void testRingAndNoVibrate() {
         mRingerUnderTest.startCallWaiting(mockCall1);
         ensureRingerIsAudible();
@@ -176,6 +194,7 @@
     }
 
     @SmallTest
+    @Test
     public void testSilentRingWithHfpStillAcquiresFocus1() {
         mRingerUnderTest.startCallWaiting(mockCall1);
         Ringtone mockRingtone = mock(Ringtone.class);
@@ -191,6 +210,7 @@
     }
 
     @SmallTest
+    @Test
     public void testSilentRingWithHfpStillAcquiresFocus2() {
         mRingerUnderTest.startCallWaiting(mockCall1);
         when(mockRingtoneFactory.getRingtone(any(Call.class))).thenReturn(null);
diff --git a/tests/src/com/android/server/telecom/tests/SessionManagerTest.java b/tests/src/com/android/server/telecom/tests/SessionManagerTest.java
index 2d9b0c6..85a9bff 100644
--- a/tests/src/com/android/server/telecom/tests/SessionManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/SessionManagerTest.java
@@ -16,16 +16,29 @@
 
 package com.android.server.telecom.tests;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 import android.telecom.Logging.Session;
 import android.telecom.Logging.SessionManager;
 import android.test.suitebuilder.annotation.SmallTest;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
 import java.lang.ref.WeakReference;
 
 /**
  * Unit tests for android.telecom.Logging.SessionManager
  */
 
+@RunWith(JUnit4.class)
 public class SessionManagerTest extends TelecomTestCase {
 
     private static final String TEST_PARENT_NAME = "testParent";
@@ -40,6 +53,7 @@
     private String mFullSessionMethodName = "";
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         mTestSessionManager = new SessionManager();
@@ -52,6 +66,7 @@
     }
 
     @Override
+    @After
     public void tearDown() throws Exception {
         mFullSessionMethodName = "";
         mfullSessionCompleteTime = Session.UNDEFINED;
@@ -63,6 +78,7 @@
      * Starts a Session on the current thread and verifies that it exists in the HashMap
      */
     @SmallTest
+    @Test
     public void testStartSession() {
         assertTrue(mTestSessionManager.mSessionMapper.isEmpty());
 
@@ -81,6 +97,7 @@
      * session and the second session will be attached to that thread ID.
      */
     @SmallTest
+    @Test
     public void testStartInvisibleChildSession() {
         assertTrue(mTestSessionManager.mSessionMapper.isEmpty());
 
@@ -105,6 +122,7 @@
      * End the active Session and verify that it is completed and removed from mSessionMapper.
      */
     @SmallTest
+    @Test
     public void testEndSession() {
         assertTrue(mTestSessionManager.mSessionMapper.isEmpty());
         // Set the thread Id to 0
@@ -129,6 +147,7 @@
      * into mSessionMapper.
      */
     @SmallTest
+    @Test
     public void testEndInvisibleChildSession() {
         assertTrue(mTestSessionManager.mSessionMapper.isEmpty());
         // Set the thread Id to 0 for the parent
@@ -154,6 +173,7 @@
      * in a different thread.
      */
     @SmallTest
+    @Test
     public void testCreateSubsession() {
         mTestSessionManager.mCurrentThreadId = () -> TEST_PARENT_THREAD_ID;
         mTestSessionManager.startSession(TEST_PARENT_NAME, null);
@@ -176,6 +196,7 @@
      * marked as completed and never added to mSessionMapper.
      */
     @SmallTest
+    @Test
     public void testCancelSubsession() {
         mTestSessionManager.mCurrentThreadId = () -> TEST_PARENT_THREAD_ID;
         mTestSessionManager.startSession(TEST_PARENT_NAME, null);
@@ -196,6 +217,7 @@
      * its parent are in mSessionMapper.
      */
     @SmallTest
+    @Test
     public void testContinueSubsession() {
         mTestSessionManager.mCurrentThreadId = () -> TEST_PARENT_THREAD_ID;
         mTestSessionManager.startSession(TEST_PARENT_NAME, null);
@@ -219,6 +241,7 @@
      * no longer exists in mSessionMapper.
      */
     @SmallTest
+    @Test
     public void testEndSubsession() {
         mTestSessionManager.mCurrentThreadId = () -> TEST_PARENT_THREAD_ID;
         mTestSessionManager.startSession(TEST_PARENT_NAME, null);
@@ -241,6 +264,7 @@
      * sessions that are complete as well and note the completion time of the entire chain.
      */
     @SmallTest
+    @Test
     public void testEndSubsessionWithParentComplete() {
         mTestSessionManager.mCurrentThreadId = () -> TEST_PARENT_THREAD_ID;
         mTestSessionManager.startSession(TEST_PARENT_NAME, null);
@@ -276,6 +300,7 @@
      * correctly generates the child session.
      */
     @SmallTest
+    @Test
     public void testStartExternalSession() {
         mTestSessionManager.mCurrentThreadId = () -> TEST_PARENT_THREAD_ID;
         mTestSessionManager.startSession(TEST_PARENT_NAME, null);
@@ -298,6 +323,7 @@
      * external session from mSessionMapper.
      */
     @SmallTest
+    @Test
     public void testEndExternalSession() {
         mTestSessionManager.mCurrentThreadId = () -> TEST_PARENT_THREAD_ID;
         mTestSessionManager.startSession(TEST_PARENT_NAME, null);
@@ -323,6 +349,7 @@
      * the external Session, but the one subsession underneath.
      */
     @SmallTest
+    @Test
     public void testEndExternalSessionListenerCallback() {
         mTestSessionManager.mCurrentThreadId = () -> TEST_PARENT_THREAD_ID;
         mTestSessionManager.startSession(TEST_PARENT_NAME, null);
@@ -346,6 +373,7 @@
      * Verifies that the recursive method for getting the full ID works correctly.
      */
     @SmallTest
+    @Test
     public void testFullMethodPath() {
         mTestSessionManager.mCurrentThreadId = () -> TEST_PARENT_THREAD_ID;
         mTestSessionManager.startSession(TEST_PARENT_NAME, null);
@@ -364,6 +392,7 @@
      * correctly to ensure that there are no dangling sessions.
      */
     @SmallTest
+    @Test
     public void testStaleSessionCleanupTimer() {
         mTestSessionManager.mCurrentThreadId = () -> TEST_PARENT_THREAD_ID;
         mTestSessionManager.startSession(TEST_PARENT_NAME, null);
diff --git a/tests/src/com/android/server/telecom/tests/SystemStateProviderTest.java b/tests/src/com/android/server/telecom/tests/SystemStateProviderTest.java
index ad740f4..033f929 100644
--- a/tests/src/com/android/server/telecom/tests/SystemStateProviderTest.java
+++ b/tests/src/com/android/server/telecom/tests/SystemStateProviderTest.java
@@ -16,6 +16,9 @@
 
 package com.android.server.telecom.tests;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -31,6 +34,11 @@
 import com.android.server.telecom.SystemStateProvider;
 import com.android.server.telecom.SystemStateProvider.SystemStateListener;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
@@ -38,10 +46,9 @@
 /**
  * Unit tests for SystemStateProvider
  */
+@RunWith(JUnit4.class)
 public class SystemStateProviderTest extends TelecomTestCase {
 
-    SystemStateProvider mSystemStateProvider;
-
     @Mock Context mContext;
     @Mock SystemStateListener mSystemStateListener;
     @Mock UiModeManager mUiModeManager;
@@ -49,17 +56,20 @@
     @Mock Intent mIntentExit;
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         MockitoAnnotations.initMocks(this);
     }
 
     @Override
+    @After
     public void tearDown() throws Exception {
         super.tearDown();
     }
 
     @SmallTest
+    @Test
     public void testListeners() throws Exception {
         SystemStateProvider systemStateProvider = new SystemStateProvider(mContext);
 
@@ -70,6 +80,7 @@
     }
 
     @SmallTest
+    @Test
     public void testQuerySystemForCarMode_True() {
         when(mContext.getSystemService(Context.UI_MODE_SERVICE)).thenReturn(mUiModeManager);
         when(mUiModeManager.getCurrentModeType()).thenReturn(Configuration.UI_MODE_TYPE_CAR);
@@ -77,6 +88,7 @@
     }
 
     @SmallTest
+    @Test
     public void testQuerySystemForCarMode_False() {
         when(mContext.getSystemService(Context.UI_MODE_SERVICE)).thenReturn(mUiModeManager);
         when(mUiModeManager.getCurrentModeType()).thenReturn(Configuration.UI_MODE_TYPE_NORMAL);
@@ -84,6 +96,7 @@
     }
 
     @SmallTest
+    @Test
     public void testReceiverAndIntentFilter() {
         ArgumentCaptor<IntentFilter> intentFilter = ArgumentCaptor.forClass(IntentFilter.class);
         new SystemStateProvider(mContext);
@@ -95,6 +108,7 @@
     }
 
     @SmallTest
+    @Test
     public void testOnEnterExitCarMode() {
         ArgumentCaptor<BroadcastReceiver> receiver =
                 ArgumentCaptor.forClass(BroadcastReceiver.class);
diff --git a/tests/src/com/android/server/telecom/tests/TODO b/tests/src/com/android/server/telecom/tests/TODO
deleted file mode 100644
index f412b4a..0000000
--- a/tests/src/com/android/server/telecom/tests/TODO
+++ /dev/null
@@ -1,14 +0,0 @@
-* Implement acquireProvider("settings")
-* Implement acquireUnstableProvider("com.android.contacts")
-* ComponentContextFixture to have "setUp/tearDown" to check for things like un-released providers
-
-Bluetooth
-Speakerphone and audio modes
-Video calling
-Connection managers
-DTMF tones
-Call logging
-Ringback
-Missed calls
-Respond via SMS
-Permissions in registering PhoneAccounts
diff --git a/tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java b/tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java
index bf2e8f8..b19e5d3 100644
--- a/tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java
+++ b/tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java
@@ -53,6 +53,10 @@
 import com.android.server.telecom.components.UserCallIntentProcessor;
 import com.android.server.telecom.components.UserCallIntentProcessorFactory;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 import org.mockito.ArgumentMatcher;
 import org.mockito.Mock;
@@ -63,6 +67,11 @@
 
 import static android.Manifest.permission.REGISTER_SIM_SUBSCRIPTION;
 import static android.Manifest.permission.WRITE_SECURE_SETTINGS;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 import static org.mockito.ArgumentMatchers.nullable;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyBoolean;
@@ -80,6 +89,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(JUnit4.class)
 public class TelecomServiceImplTest extends TelecomTestCase {
     public static class CallIntentProcessAdapterFake implements CallIntentProcessor.Adapter {
         @Override
@@ -148,6 +158,7 @@
             new ComponentName("test", "sipComponentName"), "3", Binder.getCallingUserHandle());
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         mContext = mComponentContextFixture.getTestDouble().getApplicationContext();
@@ -186,6 +197,7 @@
     }
 
     @SmallTest
+    @Test
     public void testGetDefaultOutgoingPhoneAccount() throws RemoteException {
         when(mFakePhoneAccountRegistrar
                 .getOutgoingPhoneAccountForScheme(eq("tel"), any(UserHandle.class)))
@@ -205,6 +217,7 @@
     }
 
     @SmallTest
+    @Test
     public void testGetDefaultOutgoingPhoneAccountFailure() throws RemoteException {
         // make sure that the list of user profiles doesn't include anything the PhoneAccountHandles
         // are associated with
@@ -225,6 +238,7 @@
     }
 
     @SmallTest
+    @Test
     public void testGetUserSelectedOutgoingPhoneAccount() throws RemoteException {
         when(mFakePhoneAccountRegistrar.getUserSelectedOutgoingPhoneAccount(any(UserHandle.class)))
                 .thenReturn(TEL_PA_HANDLE_16);
@@ -237,6 +251,7 @@
     }
 
     @SmallTest
+    @Test
     public void testSetUserSelectedOutgoingPhoneAccount() throws RemoteException {
         mTSIBinder.setUserSelectedOutgoingPhoneAccount(TEL_PA_HANDLE_16);
         verify(mFakePhoneAccountRegistrar)
@@ -244,6 +259,7 @@
     }
 
     @SmallTest
+    @Test
     public void testSetUserSelectedOutgoingPhoneAccountFailure() throws RemoteException {
         doThrow(new SecurityException()).when(mContext).enforceCallingOrSelfPermission(
                 anyString(), nullable(String.class));
@@ -258,6 +274,7 @@
     }
 
     @SmallTest
+    @Test
     public void testGetCallCapablePhoneAccounts() throws RemoteException {
         List<PhoneAccountHandle> fullPHList = new ArrayList<PhoneAccountHandle>() {{
             add(TEL_PA_HANDLE_16);
@@ -284,6 +301,7 @@
     }
 
     @SmallTest
+    @Test
     public void testGetCallCapablePhoneAccountsFailure() throws RemoteException {
         List<String> enforcedPermissions = new ArrayList<String>() {{
             add(READ_PHONE_STATE);
@@ -304,6 +322,7 @@
     }
 
     @SmallTest
+    @Test
     public void testGetPhoneAccountsSupportingScheme() throws RemoteException {
         List<PhoneAccountHandle> sipPHList = new ArrayList<PhoneAccountHandle>() {{
             add(SIP_PA_HANDLE_17);
@@ -327,6 +346,7 @@
     }
 
     @SmallTest
+    @Test
     public void testGetPhoneAccountsForPackage() throws RemoteException {
         List<PhoneAccountHandle> phoneAccountHandleList = new ArrayList<PhoneAccountHandle>() {{
             add(TEL_PA_HANDLE_16);
@@ -342,6 +362,7 @@
     }
 
     @SmallTest
+    @Test
     public void testGetPhoneAccount() throws RemoteException {
         makeAccountsVisibleToAllUsers(TEL_PA_HANDLE_16, SIP_PA_HANDLE_17);
         assertEquals(TEL_PA_HANDLE_16, mTSIBinder.getPhoneAccount(TEL_PA_HANDLE_16)
@@ -351,6 +372,7 @@
     }
 
     @SmallTest
+    @Test
     public void testGetAllPhoneAccounts() throws RemoteException {
         List<PhoneAccount> phoneAccountList = new ArrayList<PhoneAccount>() {{
             add(makePhoneAccount(TEL_PA_HANDLE_16).build());
@@ -363,6 +385,7 @@
     }
 
     @SmallTest
+    @Test
     public void testRegisterPhoneAccount() throws RemoteException {
         String packageNameToUse = "com.android.officialpackage";
         PhoneAccountHandle phHandle = new PhoneAccountHandle(new ComponentName(
@@ -375,6 +398,7 @@
     }
 
     @SmallTest
+    @Test
     public void testRegisterPhoneAccountWithoutModifyPermission() throws RemoteException {
         // tests the case where the package does not have MODIFY_PHONE_STATE but is
         // registering its own phone account as a third-party connection service
@@ -392,6 +416,7 @@
     }
 
     @SmallTest
+    @Test
     public void testRegisterPhoneAccountWithoutModifyPermissionFailure() throws RemoteException {
         // tests the case where the third party package should not be allowed to register a phone
         // account due to the lack of modify permission.
@@ -409,6 +434,7 @@
     }
 
     @SmallTest
+    @Test
     public void testRegisterPhoneAccountWithoutSimSubscriptionPermissionFailure()
             throws RemoteException {
         String packageNameToUse = "com.thirdparty.connectionservice";
@@ -428,6 +454,7 @@
     }
 
     @SmallTest
+    @Test
     public void testRegisterPhoneAccountWithoutMultiUserPermissionFailure()
             throws Exception {
         String packageNameToUse = "com.thirdparty.connectionservice";
@@ -466,6 +493,7 @@
     }
 
     @SmallTest
+    @Test
     public void testUnregisterPhoneAccount() throws RemoteException {
         String packageNameToUse = "com.android.officialpackage";
         PhoneAccountHandle phHandle = new PhoneAccountHandle(new ComponentName(
@@ -480,6 +508,7 @@
     }
 
     @SmallTest
+    @Test
     public void testUnregisterPhoneAccountFailure() throws RemoteException {
         String packageNameToUse = "com.thirdparty.connectionservice";
         PhoneAccountHandle phHandle = new PhoneAccountHandle(new ComponentName(
@@ -502,6 +531,7 @@
     }
 
     @SmallTest
+    @Test
     public void testAddNewIncomingCall() throws Exception {
         PhoneAccount phoneAccount = makePhoneAccount(TEL_PA_HANDLE_CURRENT).build();
         phoneAccount.setIsEnabled(true);
@@ -517,6 +547,7 @@
     }
 
     @SmallTest
+    @Test
     public void testAddNewIncomingCallFailure() throws Exception {
         try {
             mTSIBinder.addNewIncomingCall(TEL_PA_HANDLE_16, null);
@@ -538,6 +569,7 @@
     }
 
     @SmallTest
+    @Test
     public void testAddNewUnknownCall() throws Exception {
         PhoneAccount phoneAccount = makePhoneAccount(TEL_PA_HANDLE_CURRENT).build();
         phoneAccount.setIsEnabled(true);
@@ -553,6 +585,7 @@
     }
 
     @SmallTest
+    @Test
     public void testAddNewUnknownCallFailure() throws Exception {
         try {
             mTSIBinder.addNewUnknownCall(TEL_PA_HANDLE_16, null);
@@ -603,6 +636,7 @@
     }
 
     @SmallTest
+    @Test
     public void testPlaceCallWithNonEmergencyPermission() throws Exception {
         Uri handle = Uri.parse("tel:6505551234");
         Bundle extras = createSampleExtras();
@@ -617,6 +651,7 @@
     }
 
     @SmallTest
+    @Test
     public void testPlaceCallWithAppOpsOff() throws Exception {
         Uri handle = Uri.parse("tel:6505551234");
         Bundle extras = createSampleExtras();
@@ -631,6 +666,7 @@
     }
 
     @SmallTest
+    @Test
     public void testPlaceCallWithNoCallingPermission() throws Exception {
         Uri handle = Uri.parse("tel:6505551234");
         Bundle extras = createSampleExtras();
@@ -656,6 +692,7 @@
     }
 
     @SmallTest
+    @Test
     public void testPlaceCallFailure() throws Exception {
         Uri handle = Uri.parse("tel:6505551234");
         Bundle extras = createSampleExtras();
@@ -674,6 +711,7 @@
     }
 
     @SmallTest
+    @Test
     public void testSetDefaultDialer() throws Exception {
         String packageName = "sample.package";
         int currentUser = ActivityManager.getCurrentUser();
@@ -694,6 +732,7 @@
     }
 
     @SmallTest
+    @Test
     public void testSetDefaultDialerNoModifyPhoneStatePermission() throws Exception {
         doThrow(new SecurityException()).when(mContext).enforceCallingOrSelfPermission(
                 eq(MODIFY_PHONE_STATE), nullable(String.class));
@@ -701,6 +740,7 @@
     }
 
     @SmallTest
+    @Test
     public void testSetDefaultDialerNoWriteSecureSettingsPermission() throws Exception {
         doThrow(new SecurityException()).when(mContext).enforceCallingOrSelfPermission(
                 eq(WRITE_SECURE_SETTINGS), nullable(String.class));
@@ -720,6 +760,7 @@
     }
 
     @SmallTest
+    @Test
     public void testIsVoicemailNumber() throws Exception {
         String vmNumber = "010";
         makeAccountsVisibleToAllUsers(TEL_PA_HANDLE_CURRENT);
@@ -731,6 +772,7 @@
     }
 
     @SmallTest
+    @Test
     public void testIsVoicemailNumberAccountNotVisibleFailure() throws Exception {
         String vmNumber = "010";
 
@@ -744,6 +786,7 @@
     }
 
     @SmallTest
+    @Test
     public void testGetVoicemailNumberWithNullAccountHandle() throws Exception {
         when(mFakePhoneAccountRegistrar.getPhoneAccount(isNull(PhoneAccountHandle.class),
                 eq(Binder.getCallingUserHandle())))
@@ -760,6 +803,7 @@
     }
 
     @SmallTest
+    @Test
     public void testGetVoicemailNumberWithNonNullAccountHandle() throws Exception {
         when(mFakePhoneAccountRegistrar.getPhoneAccount(eq(TEL_PA_HANDLE_CURRENT),
                 eq(Binder.getCallingUserHandle())))
@@ -778,6 +822,7 @@
     }
 
     @SmallTest
+    @Test
     public void testGetLine1Number() throws Exception {
         int subId = 58374;
         String line1Number = "9482752023479";
@@ -793,6 +838,7 @@
     }
 
     @SmallTest
+    @Test
     public void testEndCallWithRingingForegroundCall() throws Exception {
         Call call = mock(Call.class);
         when(call.getState()).thenReturn(CallState.RINGING);
@@ -802,6 +848,7 @@
     }
 
     @SmallTest
+    @Test
     public void testEndCallWithNonRingingForegroundCall() throws Exception {
         Call call = mock(Call.class);
         when(call.getState()).thenReturn(CallState.ACTIVE);
@@ -811,6 +858,7 @@
     }
 
     @SmallTest
+    @Test
     public void testEndCallWithNoForegroundCall() throws Exception {
         Call call = mock(Call.class);
         when(call.getState()).thenReturn(CallState.ACTIVE);
@@ -821,11 +869,13 @@
     }
 
     @SmallTest
+    @Test
     public void testEndCallWithNoCalls() throws Exception {
         assertFalse(mTSIBinder.endCall());
     }
 
     @SmallTest
+    @Test
     public void testAcceptRingingCall() throws Exception {
         Call call = mock(Call.class);
         when(mFakeCallsManager.getFirstCallWithState(anyInt())).thenReturn(call);
@@ -838,6 +888,7 @@
     }
 
     @SmallTest
+    @Test
     public void testAcceptRingingCallWithValidVideoState() throws Exception {
         Call call = mock(Call.class);
         when(mFakeCallsManager.getFirstCallWithState(anyInt())).thenReturn(call);
@@ -851,18 +902,21 @@
     }
 
     @SmallTest
+    @Test
     public void testIsInCall() throws Exception {
         when(mFakeCallsManager.hasOngoingCalls()).thenReturn(true);
         assertTrue(mTSIBinder.isInCall(DEFAULT_DIALER_PACKAGE));
     }
 
     @SmallTest
+    @Test
     public void testNotIsInCall() throws Exception {
         when(mFakeCallsManager.hasOngoingCalls()).thenReturn(false);
         assertFalse(mTSIBinder.isInCall(DEFAULT_DIALER_PACKAGE));
     }
 
     @SmallTest
+    @Test
     public void testIsInCallFail() throws Exception {
         doThrow(new SecurityException()).when(mContext).enforceCallingOrSelfPermission(
                 anyString(), any());
@@ -876,18 +930,21 @@
     }
 
     @SmallTest
+    @Test
     public void testIsInManagedCall() throws Exception {
         when(mFakeCallsManager.hasOngoingManagedCalls()).thenReturn(true);
         assertTrue(mTSIBinder.isInManagedCall(DEFAULT_DIALER_PACKAGE));
     }
 
     @SmallTest
+    @Test
     public void testNotIsInManagedCall() throws Exception {
         when(mFakeCallsManager.hasOngoingManagedCalls()).thenReturn(false);
         assertFalse(mTSIBinder.isInManagedCall(DEFAULT_DIALER_PACKAGE));
     }
 
     @SmallTest
+    @Test
     public void testIsInManagedCallFail() throws Exception {
         doThrow(new SecurityException()).when(mContext).enforceCallingOrSelfPermission(
                 anyString(), any());
diff --git a/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java b/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java
index b84f9d5..f369049 100644
--- a/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java
+++ b/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java
@@ -17,6 +17,10 @@
 package com.android.server.telecom.tests;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 import static org.mockito.ArgumentMatchers.nullable;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyBoolean;
@@ -35,7 +39,6 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
-import android.app.NotificationManager;
 import android.content.BroadcastReceiver;
 import android.content.ComponentName;
 import android.content.ContentResolver;
@@ -467,8 +470,8 @@
     }
 
     private void setupConnectionServices() throws Exception {
-        mConnectionServiceFixtureA = new ConnectionServiceFixture();
-        mConnectionServiceFixtureB = new ConnectionServiceFixture();
+        mConnectionServiceFixtureA = new ConnectionServiceFixture(mContext);
+        mConnectionServiceFixtureB = new ConnectionServiceFixture(mContext);
 
         mComponentContextFixture.addConnectionService(mConnectionServiceComponentNameA,
                 mConnectionServiceFixtureA.getTestDouble());
diff --git a/tests/src/com/android/server/telecom/tests/TelecomTestCase.java b/tests/src/com/android/server/telecom/tests/TelecomTestCase.java
index 1892b99..b656c98 100644
--- a/tests/src/com/android/server/telecom/tests/TelecomTestCase.java
+++ b/tests/src/com/android/server/telecom/tests/TelecomTestCase.java
@@ -18,30 +18,31 @@
 
 import org.mockito.MockitoAnnotations;
 
+import android.content.Context;
 import android.os.Handler;
+import android.support.test.InstrumentationRegistry;
 import android.telecom.Log;
-import android.test.AndroidTestCase;
 
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-public abstract class TelecomTestCase extends AndroidTestCase {
+public abstract class TelecomTestCase {
     protected static final String TESTING_TAG = "Telecom-TEST";
+    protected Context mContext;
 
     MockitoHelper mMockitoHelper = new MockitoHelper();
     ComponentContextFixture mComponentContextFixture;
 
-    @Override
     public void setUp() throws Exception {
         Log.setTag(TESTING_TAG);
-        mMockitoHelper.setUp(getContext(), getClass());
+        mMockitoHelper.setUp(InstrumentationRegistry.getContext(), getClass());
         mComponentContextFixture = new ComponentContextFixture();
+        mContext = mComponentContextFixture.getTestDouble().getApplicationContext();
         Log.setSessionContext(mComponentContextFixture.getTestDouble().getApplicationContext());
         Log.getSessionManager().mCleanStaleSessions = null;
         MockitoAnnotations.initMocks(this);
     }
 
-    @Override
     public void tearDown() throws Exception {
         mComponentContextFixture = null;
         mMockitoHelper.tearDown();
diff --git a/tests/src/com/android/server/telecom/tests/VideoCallTests.java b/tests/src/com/android/server/telecom/tests/VideoCallTests.java
index c91f86e..97e71d1 100644
--- a/tests/src/com/android/server/telecom/tests/VideoCallTests.java
+++ b/tests/src/com/android/server/telecom/tests/VideoCallTests.java
@@ -16,6 +16,11 @@
 
 package com.android.server.telecom.tests;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 
 import android.os.Process;
@@ -31,6 +36,10 @@
 
 import java.util.List;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 import static org.mockito.Mockito.atLeastOnce;
 import static org.mockito.Mockito.verify;
 
@@ -39,13 +48,27 @@
  * TODO: Add unit tests which ensure that auto-speakerphone does not occur when using a wired
  * headset or a bluetooth headset.
  */
+@RunWith(JUnit4.class)
 public class VideoCallTests extends TelecomSystemTest {
 
+    @Override
+    @Before
+    public void setUp() throws Exception {
+        super.setUp();
+    }
+
+    @Override
+    @After
+    public void tearDown() throws Exception {
+        super.tearDown();
+    }
+
     /**
      * Tests to ensure an incoming video-call is automatically routed to the speakerphone when
      * the call is answered and neither a wired headset nor bluetooth headset are connected.
      */
     @MediumTest
+    @Test
     public void testAutoSpeakerphoneIncomingBidirectional() throws Exception {
         // Start an incoming video call.
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
@@ -62,6 +85,7 @@
      * party dialer to answer an incoming video call a a one-way video call.
      */
     @MediumTest
+    @Test
     public void testAutoSpeakerphoneIncomingReceiveOnly() throws Exception {
         // Start an incoming video call.
         IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
@@ -76,6 +100,7 @@
      * in speaker mode.
      */
     @MediumTest
+    @Test
     public void testAutoSpeakerphoneOutgoingBidirectional() throws Exception {
         // Start an incoming video call.
         IdPair ids = startAndMakeActiveOutgoingCall("650-555-1212",
@@ -91,6 +116,7 @@
      * APIs do and a third party incall UI could choose to support that.
      */
     @MediumTest
+    @Test
     public void testAutoSpeakerphoneOutgoingTransmitOnly() throws Exception {
         // Start an incoming video call.
         IdPair ids = startAndMakeActiveOutgoingCall("650-555-1212",
@@ -106,6 +132,7 @@
      * APIs do and a third party incall UI could choose to support that.
      */
     @MediumTest
+    @Test
     public void testNoAutoSpeakerphoneOnOutgoing() throws Exception {
         // Start an incoming video call.
         IdPair ids = startAndMakeActiveOutgoingCall("650-555-1212",
@@ -119,6 +146,7 @@
      * Tests to ensure an incoming audio-only call is routed to the earpiece.
      */
     @MediumTest
+    @Test
     public void testNoAutoSpeakerphoneOnIncoming() throws Exception {
 
         // Start an incoming video call.
@@ -134,6 +162,7 @@
      * video calling. This is important for the call log.
      */
     @LargeTest
+    @Test
     public void testIncomingVideoCallMissedCheckVideoHistory() throws Exception {
         IdPair ids = startIncomingPhoneCall("650-555-1212", mPhoneAccountA0.getAccountHandle(),
                 VideoProfile.STATE_BIDIRECTIONAL, mConnectionServiceFixtureA);
@@ -150,6 +179,7 @@
      * video calling. This is important for the call log.
      */
     @LargeTest
+    @Test
     public void testIncomingVideoCallRejectedCheckVideoHistory() throws Exception {
         IdPair ids = startIncomingPhoneCall("650-555-1212", mPhoneAccountA0.getAccountHandle(),
                 VideoProfile.STATE_BIDIRECTIONAL, mConnectionServiceFixtureA);
@@ -167,6 +197,7 @@
      * video calling. This is important for the call log.
      */
     @LargeTest
+    @Test
     public void testOutgoingVideoCallCanceledCheckVideoHistory() throws Exception {
         IdPair ids = startOutgoingPhoneCall("650-555-1212", mPhoneAccountA0.getAccountHandle(),
                 mConnectionServiceFixtureA, Process.myUserHandle(),
@@ -184,6 +215,7 @@
      * video calling. This is important for the call log.
      */
     @LargeTest
+    @Test
     public void testOutgoingVideoCallRejectedCheckVideoHistory() throws Exception {
         IdPair ids = startOutgoingPhoneCall("650-555-1212", mPhoneAccountA0.getAccountHandle(),
                 mConnectionServiceFixtureA, Process.myUserHandle(),
@@ -201,6 +233,7 @@
      * shows that the call was audio only. This is important for the call log.
      */
     @LargeTest
+    @Test
     public void testOutgoingVideoCallAnsweredAsAudio() throws Exception {
         IdPair ids = startOutgoingPhoneCall("650-555-1212", mPhoneAccountA0.getAccountHandle(),
                 mConnectionServiceFixtureA, Process.myUserHandle(),
diff --git a/tests/src/com/android/server/telecom/tests/VideoProfileTest.java b/tests/src/com/android/server/telecom/tests/VideoProfileTest.java
index 8e972e6..6acadf7 100644
--- a/tests/src/com/android/server/telecom/tests/VideoProfileTest.java
+++ b/tests/src/com/android/server/telecom/tests/VideoProfileTest.java
@@ -16,15 +16,24 @@
 
 package com.android.server.telecom.tests;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import android.telecom.VideoProfile;
-import android.test.AndroidTestCase;
 import android.test.suitebuilder.annotation.SmallTest;
 
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
 /**
  * Unit tests for the {@link android.telecom.VideoProfile} class.
  */
-public class VideoProfileTest extends AndroidTestCase {
+@RunWith(JUnit4.class)
+public class VideoProfileTest extends TelecomTestCase {
     @SmallTest
+    @Test
     public void testToString() {
         assertEquals("Audio Only", VideoProfile.videoStateToString(VideoProfile.STATE_AUDIO_ONLY));
         assertEquals("Audio Tx", VideoProfile.videoStateToString(VideoProfile.STATE_TX_ENABLED));
@@ -42,6 +51,7 @@
     }
 
     @SmallTest
+    @Test
     public void testIsAudioOnly() {
         assertFalse(VideoProfile.isAudioOnly(VideoProfile.STATE_RX_ENABLED));
         assertFalse(VideoProfile.isAudioOnly(VideoProfile.STATE_TX_ENABLED));
diff --git a/tests/src/com/android/server/telecom/tests/VideoProviderTest.java b/tests/src/com/android/server/telecom/tests/VideoProviderTest.java
index 3234c1f..75dc36f 100644
--- a/tests/src/com/android/server/telecom/tests/VideoProviderTest.java
+++ b/tests/src/com/android/server/telecom/tests/VideoProviderTest.java
@@ -16,10 +16,13 @@
 
 package com.android.server.telecom.tests;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.internal.exceptions.ExceptionIncludingMockitoWarnings;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
@@ -46,7 +49,7 @@
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import static android.test.MoreAsserts.assertEquals;
+import static org.junit.Assert.assertEquals;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyInt;
 import static org.mockito.Matchers.anyLong;
@@ -56,17 +59,16 @@
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
 
 /**
  * Performs tests of the {@link VideoProvider} and {@link VideoCall} APIs.  Ensures that requests
  * sent from an InCallService are routed through Telecom to a VideoProvider, and that callbacks are
  * correctly routed.
  */
+@RunWith(JUnit4.class)
 public class VideoProviderTest extends TelecomSystemTest {
     private static final int ORIENTATION_0 = 0;
     private static final int ORIENTATION_90 = 90;
@@ -89,6 +91,7 @@
     };
 
     @Override
+    @Before
     public void setUp() throws Exception {
         super.setUp();
         mContext = mComponentContextFixture.getTestDouble().getApplicationContext();
@@ -121,6 +124,7 @@
     }
 
     @Override
+    @After
     public void tearDown() throws Exception {
         super.tearDown();
     }
@@ -131,6 +135,7 @@
      * APIS.
      */
     @MediumTest
+    @Test
     public void testCameraChange() throws Exception {
         // Wait until the callback has been received before performing verification.
         doAnswer(mVerification).when(mVideoCallCallback)
@@ -165,6 +170,7 @@
      * change from a non-permitted caller is ignored.
      */
     @MediumTest
+    @Test
     public void testCameraChangePermissionFail() throws Exception {
         // Wait until the callback has been received before performing verification.
         doAnswer(mVerification).when(mVideoCallCallback).onCallSessionEvent(anyInt());
@@ -193,6 +199,7 @@
      * change from a non-permitted caller is ignored.
      */
     @MediumTest
+    @Test
     public void testCameraChangeAppOpsFail() throws Exception {
         // Wait until the callback has been received before performing verification.
         doAnswer(mVerification).when(mVideoCallCallback).onCallSessionEvent(anyInt());
@@ -222,6 +229,7 @@
      * of a CAMERA_PERMISSION_ERROR.
      */
     @MediumTest
+    @Test
     public void testCameraChangeAppOpsBelowNMR1Fail() throws Exception {
         // Wait until the callback has been received before performing verification.
         doAnswer(mVerification).when(mVideoCallCallback).onCallSessionEvent(anyInt());
@@ -251,6 +259,7 @@
      * change from a background user is not permitted.
      */
     @MediumTest
+    @Test
     public void testCameraChangeUserFail() throws Exception {
         // Wait until the callback has been received before performing verification.
         doAnswer(mVerification).when(mVideoCallCallback).onCallSessionEvent(anyInt());
@@ -278,6 +287,7 @@
      * caller can null out the camera, even if they do not have camera permission.
      */
     @MediumTest
+    @Test
     public void testCameraChangeNullNoPermission() throws Exception {
         // Wait until the callback has been received before performing verification.
         doAnswer(mVerification).when(mVideoCallCallback).onCallSessionEvent(anyInt());
@@ -306,6 +316,7 @@
      * {@link VideoProvider#onSetPreviewSurface(Surface)} APIs.
      */
     @MediumTest
+    @Test
     public void testSetPreviewSurface() throws Exception {
         final Surface surface = new Surface(new SurfaceTexture(1));
         mVideoCall.setPreviewSurface(surface);
@@ -332,6 +343,7 @@
      * {@link VideoProvider#onSetDisplaySurface(Surface)} APIs.
      */
     @MediumTest
+    @Test
     public void testSetDisplaySurface() throws Exception {
         final Surface surface = new Surface(new SurfaceTexture(1));
         mVideoCall.setDisplaySurface(surface);
@@ -358,6 +370,7 @@
      * {@link VideoProvider#onSetDeviceOrientation(int)} APIs.
      */
     @MediumTest
+    @Test
     public void testSetDeviceOrientation() throws Exception {
         mVideoCall.setDeviceOrientation(ORIENTATION_0);
 
@@ -382,6 +395,7 @@
      * Tests the {@link VideoCall#setZoom(float)} and {@link VideoProvider#onSetZoom(float)} APIs.
      */
     @MediumTest
+    @Test
     public void testSetZoom() throws Exception {
         mVideoCall.setZoom(ZOOM_LEVEL);
 
@@ -404,6 +418,7 @@
      * peer accepts as-is.
      */
     @MediumTest
+    @Test
     public void testSessionModifyRequest() throws Exception {
         VideoProfile requestProfile = new VideoProfile(VideoProfile.STATE_BIDIRECTIONAL);
 
@@ -442,6 +457,7 @@
      * and {@link VideoProvider#onSendSessionModifyResponse(VideoProfile)} APIs.
      */
     @MediumTest
+    @Test
     public void testSessionModifyResponse() throws Exception {
         VideoProfile sessionModifyResponse = new VideoProfile(VideoProfile.STATE_TX_ENABLED);
 
@@ -463,6 +479,7 @@
      * {@link VideoCall.Callback#onCameraCapabilitiesChanged(CameraCapabilities)} APIs.
      */
     @MediumTest
+    @Test
     public void testRequestCameraCapabilities() throws Exception {
         // Wait until the callback has been received before performing verification.
         doAnswer(mVerification).when(mVideoCallCallback)
@@ -481,6 +498,7 @@
      * {@link VideoProvider#onSetPauseImage(Uri)} APIs.
      */
     @MediumTest
+    @Test
     public void testSetPauseImage() throws Exception {
         final Uri testUri = Uri.fromParts("file", "test.jpg", null);
         mVideoCall.setPauseImage(testUri);
@@ -500,6 +518,7 @@
      * {@link VideoCall.Callback#onCallDataUsageChanged(long)} APIs.
      */
     @MediumTest
+    @Test
     public void testRequestDataUsage() throws Exception {
         // Wait until the callback has been received before performing verification.
         doAnswer(mVerification).when(mVideoCallCallback)
@@ -518,6 +537,7 @@
      * {@link VideoCall.Callback#onSessionModifyRequestReceived(VideoProfile)} APIs.
      */
     @MediumTest
+    @Test
     public void testReceiveSessionModifyRequest() throws Exception {
         // Wait until the callback has been received before performing verification.
         doAnswer(mVerification).when(mVideoCallCallback)
@@ -541,6 +561,7 @@
      * {@link VideoCall.Callback#onCallSessionEvent(int)} APIs.
      */
     @MediumTest
+    @Test
     public void testSessionEvent() throws Exception {
         // Wait until the callback has been received before performing verification.
         doAnswer(mVerification).when(mVideoCallCallback)
@@ -560,6 +581,7 @@
      * {@link VideoCall.Callback#onPeerDimensionsChanged(int, int)} APIs.
      */
     @MediumTest
+    @Test
     public void testPeerDimensionChange() throws Exception {
         // Wait until the callback has been received before performing verification.
         doAnswer(mVerification).when(mVideoCallCallback)
@@ -580,6 +602,7 @@
      * {@link VideoCall.Callback#onVideoQualityChanged(int)} APIs.
      */
     @MediumTest
+    @Test
     public void testVideoQualityChange() throws Exception {
         // Wait until the callback has been received before performing verification.
         doAnswer(mVerification).when(mVideoCallCallback)
