Loading android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppServiceTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -19,10 +19,12 @@ import static com.android.bluetooth.opp.BluetoothOppService.WHERE_INVISIBLE_UNCO import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isNull; import static org.mockito.Mockito.anyString; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.timeout; import static org.mockito.Mockito.verify; import static com.google.common.truth.Truth.assertThat; Loading @@ -47,6 +49,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; @MediumTest Loading Loading @@ -82,6 +85,18 @@ public class BluetoothOppServiceTest { // Try getting the Bluetooth adapter mAdapter = BluetoothAdapter.getDefaultAdapter(); Assert.assertNotNull(mAdapter); // Wait until the initial trimDatabase operation is done. verify(mBluetoothMethodProxy, timeout(3_000)) .contentResolverQuery( any(), eq(BluetoothShare.CONTENT_URI), eq(new String[] {BluetoothShare._ID}), any(), isNull(), eq(BluetoothShare._ID)); Mockito.clearInvocations(mBluetoothMethodProxy); } @After Loading Loading
android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppServiceTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -19,10 +19,12 @@ import static com.android.bluetooth.opp.BluetoothOppService.WHERE_INVISIBLE_UNCO import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isNull; import static org.mockito.Mockito.anyString; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.timeout; import static org.mockito.Mockito.verify; import static com.google.common.truth.Truth.assertThat; Loading @@ -47,6 +49,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; @MediumTest Loading Loading @@ -82,6 +85,18 @@ public class BluetoothOppServiceTest { // Try getting the Bluetooth adapter mAdapter = BluetoothAdapter.getDefaultAdapter(); Assert.assertNotNull(mAdapter); // Wait until the initial trimDatabase operation is done. verify(mBluetoothMethodProxy, timeout(3_000)) .contentResolverQuery( any(), eq(BluetoothShare.CONTENT_URI), eq(new String[] {BluetoothShare._ID}), any(), isNull(), eq(BluetoothShare._ID)); Mockito.clearInvocations(mBluetoothMethodProxy); } @After Loading