Merge "Migrate away from deprecated Truth APIs." am: b65c13a7b9 am: e52360b58f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1457153 Change-Id: I2bee34221667cb52f7a30d54670126c144b31c35
This commit is contained in:
committed by
Automerger Merge Worker
commit
1e361b9570
@@ -847,7 +847,7 @@ private val whitelistedPkgs = listOf("my.whitelisted.package")
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun onlySomeAppsAreAllowedToHavePermissionGranted() {
|
fun onlySomeAppsAreAllowedToHavePermissionGranted() {
|
||||||
assertThat(whitelistedPkgs).containsAllIn(
|
assertThat(whitelistedPkgs).containsAtLeastElementsIn(
|
||||||
context.packageManager.getInstalledPackages(MATCH_ALL)
|
context.packageManager.getInstalledPackages(MATCH_ALL)
|
||||||
.filter { pkg ->
|
.filter { pkg ->
|
||||||
context.checkPermission(android.Manifest.permission.MY_PRIVILEGED_PERMISSION, -1,
|
context.checkPermission(android.Manifest.permission.MY_PRIVILEGED_PERMISSION, -1,
|
||||||
|
|||||||
@@ -117,8 +117,8 @@ public class NotificationHistoryTest {
|
|||||||
history.addNotificationToWrite(n);
|
history.addNotificationToWrite(n);
|
||||||
|
|
||||||
assertThat(history.getNotificationsToWrite().size()).isEqualTo(2);
|
assertThat(history.getNotificationsToWrite().size()).isEqualTo(2);
|
||||||
assertThat(history.getNotificationsToWrite().get(0)).isSameAs(n2);
|
assertThat(history.getNotificationsToWrite().get(0)).isSameInstanceAs(n2);
|
||||||
assertThat(history.getNotificationsToWrite().get(1)).isSameAs(n);
|
assertThat(history.getNotificationsToWrite().get(1)).isSameInstanceAs(n);
|
||||||
assertThat(history.getHistoryCount()).isEqualTo(2);
|
assertThat(history.getHistoryCount()).isEqualTo(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,11 +141,11 @@ public class NotificationHistoryTest {
|
|||||||
history.addNotificationsToWrite(secondHistory);
|
history.addNotificationsToWrite(secondHistory);
|
||||||
|
|
||||||
assertThat(history.getNotificationsToWrite().size()).isEqualTo(5);
|
assertThat(history.getNotificationsToWrite().size()).isEqualTo(5);
|
||||||
assertThat(history.getNotificationsToWrite().get(0)).isSameAs(n3);
|
assertThat(history.getNotificationsToWrite().get(0)).isSameInstanceAs(n3);
|
||||||
assertThat(history.getNotificationsToWrite().get(1)).isSameAs(n);
|
assertThat(history.getNotificationsToWrite().get(1)).isSameInstanceAs(n);
|
||||||
assertThat(history.getNotificationsToWrite().get(2)).isSameAs(n4);
|
assertThat(history.getNotificationsToWrite().get(2)).isSameInstanceAs(n4);
|
||||||
assertThat(history.getNotificationsToWrite().get(3)).isSameAs(n2);
|
assertThat(history.getNotificationsToWrite().get(3)).isSameInstanceAs(n2);
|
||||||
assertThat(history.getNotificationsToWrite().get(4)).isSameAs(n5);
|
assertThat(history.getNotificationsToWrite().get(4)).isSameInstanceAs(n5);
|
||||||
assertThat(history.getHistoryCount()).isEqualTo(5);
|
assertThat(history.getHistoryCount()).isEqualTo(5);
|
||||||
|
|
||||||
assertThat(history.getPooledStringsToWrite()).asList().contains(n2.getChannelName());
|
assertThat(history.getPooledStringsToWrite()).asList().contains(n2.getChannelName());
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ public class CompoundFormulaTest {
|
|||||||
CompoundFormula.AND, Arrays.asList(ATOMIC_FORMULA_1, ATOMIC_FORMULA_2));
|
CompoundFormula.AND, Arrays.asList(ATOMIC_FORMULA_1, ATOMIC_FORMULA_2));
|
||||||
|
|
||||||
assertThat(compoundFormula.getConnector()).isEqualTo(CompoundFormula.AND);
|
assertThat(compoundFormula.getConnector()).isEqualTo(CompoundFormula.AND);
|
||||||
assertThat(compoundFormula.getFormulas()).containsAllOf(ATOMIC_FORMULA_1, ATOMIC_FORMULA_2);
|
assertThat(compoundFormula.getFormulas())
|
||||||
|
.containsAtLeast(ATOMIC_FORMULA_1, ATOMIC_FORMULA_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class ParseInputAndResultTest {
|
|||||||
assertError(result)
|
assertError(result)
|
||||||
assertThat(result.errorCode).isEqualTo(errorCode)
|
assertThat(result.errorCode).isEqualTo(errorCode)
|
||||||
assertThat(result.errorMessage).isEqualTo(errorMessage)
|
assertThat(result.errorMessage).isEqualTo(errorMessage)
|
||||||
assertThat(result.exception).isSameAs(exception)
|
assertThat(result.exception).isSameInstanceAs(exception)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -125,13 +125,13 @@ class ParseInputAndResultTest {
|
|||||||
assertError(result)
|
assertError(result)
|
||||||
assertThat(result.errorCode).isEqualTo(errorCode)
|
assertThat(result.errorCode).isEqualTo(errorCode)
|
||||||
assertThat(result.errorMessage).isEqualTo(errorMessage)
|
assertThat(result.errorMessage).isEqualTo(errorMessage)
|
||||||
assertThat(result.exception).isSameAs(exception)
|
assertThat(result.exception).isSameInstanceAs(exception)
|
||||||
|
|
||||||
val carriedResult = input.error<Int>(result)
|
val carriedResult = input.error<Int>(result)
|
||||||
assertError(carriedResult)
|
assertError(carriedResult)
|
||||||
assertThat(carriedResult.errorCode).isEqualTo(errorCode)
|
assertThat(carriedResult.errorCode).isEqualTo(errorCode)
|
||||||
assertThat(carriedResult.errorMessage).isEqualTo(errorMessage)
|
assertThat(carriedResult.errorMessage).isEqualTo(errorMessage)
|
||||||
assertThat(carriedResult.exception).isSameAs(exception)
|
assertThat(carriedResult.exception).isSameInstanceAs(exception)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -259,7 +259,7 @@ class ParseInputAndResultTest {
|
|||||||
private fun assertSuccess(expected: Any? = null, result: ParseResult<*>) {
|
private fun assertSuccess(expected: Any? = null, result: ParseResult<*>) {
|
||||||
assertThat(result.isError).isFalse()
|
assertThat(result.isError).isFalse()
|
||||||
assertThat(result.isSuccess).isTrue()
|
assertThat(result.isSuccess).isTrue()
|
||||||
assertThat(result.result).isSameAs(expected)
|
assertThat(result.result).isSameInstanceAs(expected)
|
||||||
assertThat(result.errorCode).isEqualTo(PackageManager.INSTALL_SUCCEEDED)
|
assertThat(result.errorCode).isEqualTo(PackageManager.INSTALL_SUCCEEDED)
|
||||||
assertThat(result.errorMessage).isNull()
|
assertThat(result.errorMessage).isNull()
|
||||||
assertThat(result.exception).isNull()
|
assertThat(result.exception).isNull()
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ public class TextClassificationManagerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetLocalTextClassifier() {
|
public void testGetLocalTextClassifier() {
|
||||||
assertThat(mTcm.getTextClassifier(TextClassifier.LOCAL)).isSameAs(TextClassifier.NO_OP);
|
assertThat(mTcm.getTextClassifier(TextClassifier.LOCAL))
|
||||||
|
.isSameInstanceAs(TextClassifier.NO_OP);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class AndroidFutureTest {
|
|||||||
future.completeExceptionally(origException);
|
future.completeExceptionally(origException);
|
||||||
ExecutionException executionException =
|
ExecutionException executionException =
|
||||||
expectThrows(ExecutionException.class, future::get);
|
expectThrows(ExecutionException.class, future::get);
|
||||||
assertThat(executionException.getCause()).isSameAs(origException);
|
assertThat(executionException.getCause()).isSameInstanceAs(origException);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -92,7 +92,7 @@ public class AndroidFutureTest {
|
|||||||
CountDownLatch latch = new CountDownLatch(1);
|
CountDownLatch latch = new CountDownLatch(1);
|
||||||
future.whenComplete((obj, err) -> {
|
future.whenComplete((obj, err) -> {
|
||||||
assertThat(obj).isNull();
|
assertThat(obj).isNull();
|
||||||
assertThat(err).isSameAs(origException);
|
assertThat(err).isSameInstanceAs(origException);
|
||||||
latch.countDown();
|
latch.countDown();
|
||||||
});
|
});
|
||||||
latch.await();
|
latch.await();
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public class BinderDeathDispatcherTest {
|
|||||||
if (!isAlive) {
|
if (!isAlive) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
assertThat(mRecipient).isSameAs(recipient);
|
assertThat(mRecipient).isSameInstanceAs(recipient);
|
||||||
mRecipient = null;
|
mRecipient = null;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class RegisterStatusBarResultTest {
|
|||||||
assertThat(copy.mImeBackDisposition).isEqualTo(original.mImeBackDisposition);
|
assertThat(copy.mImeBackDisposition).isEqualTo(original.mImeBackDisposition);
|
||||||
assertThat(copy.mShowImeSwitcher).isEqualTo(original.mShowImeSwitcher);
|
assertThat(copy.mShowImeSwitcher).isEqualTo(original.mShowImeSwitcher);
|
||||||
assertThat(copy.mDisabledFlags2).isEqualTo(original.mDisabledFlags2);
|
assertThat(copy.mDisabledFlags2).isEqualTo(original.mDisabledFlags2);
|
||||||
assertThat(copy.mImeToken).isSameAs(original.mImeToken);
|
assertThat(copy.mImeToken).isSameInstanceAs(original.mImeToken);
|
||||||
assertThat(copy.mNavbarColorManagedByIme).isEqualTo(original.mNavbarColorManagedByIme);
|
assertThat(copy.mNavbarColorManagedByIme).isEqualTo(original.mNavbarColorManagedByIme);
|
||||||
assertThat(copy.mAppFullscreen).isEqualTo(original.mAppFullscreen);
|
assertThat(copy.mAppFullscreen).isEqualTo(original.mAppFullscreen);
|
||||||
assertThat(copy.mAppImmersive).isEqualTo(original.mAppImmersive);
|
assertThat(copy.mAppImmersive).isEqualTo(original.mAppImmersive);
|
||||||
|
|||||||
@@ -1090,7 +1090,7 @@ public class WifiTrackerTest {
|
|||||||
|
|
||||||
// Verify second update AP is the same object as the first update AP
|
// Verify second update AP is the same object as the first update AP
|
||||||
assertThat(passpointAccessPointsFirstUpdate.get(0))
|
assertThat(passpointAccessPointsFirstUpdate.get(0))
|
||||||
.isSameAs(passpointAccessPointsSecondUpdate.get(0));
|
.isSameInstanceAs(passpointAccessPointsSecondUpdate.get(0));
|
||||||
// Verify second update AP has the average of the first and second update RSSIs
|
// Verify second update AP has the average of the first and second update RSSIs
|
||||||
assertThat(passpointAccessPointsSecondUpdate.get(0).getRssi())
|
assertThat(passpointAccessPointsSecondUpdate.get(0).getRssi())
|
||||||
.isEqualTo((prevRssi + newRssi) / 2);
|
.isEqualTo((prevRssi + newRssi) / 2);
|
||||||
@@ -1210,7 +1210,8 @@ public class WifiTrackerTest {
|
|||||||
providersAndScans, cachedAccessPoints);
|
providersAndScans, cachedAccessPoints);
|
||||||
|
|
||||||
// Verify second update AP is the same object as the first update AP
|
// Verify second update AP is the same object as the first update AP
|
||||||
assertThat(osuAccessPointsFirstUpdate.get(0)).isSameAs(osuAccessPointsSecondUpdate.get(0));
|
assertThat(osuAccessPointsFirstUpdate.get(0))
|
||||||
|
.isSameInstanceAs(osuAccessPointsSecondUpdate.get(0));
|
||||||
// Verify second update AP has the average of the first and second update RSSIs
|
// Verify second update AP has the average of the first and second update RSSIs
|
||||||
assertThat(osuAccessPointsSecondUpdate.get(0).getRssi())
|
assertThat(osuAccessPointsSecondUpdate.get(0).getRssi())
|
||||||
.isEqualTo((prevRssi + newRssi) / 2);
|
.isEqualTo((prevRssi + newRssi) / 2);
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class IpAddressPreferenceControllerTest {
|
|||||||
|
|
||||||
assertWithMessage("Intent filter should contain expected intents")
|
assertWithMessage("Intent filter should contain expected intents")
|
||||||
.that(ipAddressPreferenceController.getConnectivityIntents())
|
.that(ipAddressPreferenceController.getConnectivityIntents())
|
||||||
.asList().containsAllIn(expectedIntents);
|
.asList().containsAtLeastElementsIn(expectedIntents);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class ConcreteIpAddressPreferenceController extends
|
private static class ConcreteIpAddressPreferenceController extends
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class WifiMacAddressPreferenceControllerTest {
|
|||||||
|
|
||||||
assertWithMessage("Intent filter should contain expected intents")
|
assertWithMessage("Intent filter should contain expected intents")
|
||||||
.that(mController.getConnectivityIntents())
|
.that(mController.getConnectivityIntents())
|
||||||
.asList().containsAllIn(expectedIntents);
|
.asList().containsAtLeastElementsIn(expectedIntents);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ public class TileUtilsTest {
|
|||||||
|
|
||||||
assertThat(outTiles).hasSize(1);
|
assertThat(outTiles).hasSize(1);
|
||||||
final Bundle newMetaData = outTiles.get(0).getMetaData();
|
final Bundle newMetaData = outTiles.get(0).getMetaData();
|
||||||
assertThat(newMetaData).isNotSameAs(oldMetadata);
|
assertThat(newMetaData).isNotSameInstanceAs(oldMetadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ public final class ClockManagerTest extends SysuiTestCase {
|
|||||||
verify(mMockListener2).onClockChanged(captor2.capture());
|
verify(mMockListener2).onClockChanged(captor2.capture());
|
||||||
assertThat(captor1.getValue()).isInstanceOf(BUBBLE_CLOCK_CLASS);
|
assertThat(captor1.getValue()).isInstanceOf(BUBBLE_CLOCK_CLASS);
|
||||||
assertThat(captor2.getValue()).isInstanceOf(BUBBLE_CLOCK_CLASS);
|
assertThat(captor2.getValue()).isInstanceOf(BUBBLE_CLOCK_CLASS);
|
||||||
assertThat(captor1.getValue()).isNotSameAs(captor2.getValue());
|
assertThat(captor1.getValue()).isNotSameInstanceAs(captor2.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package com.android.systemui.bubbles;
|
|||||||
import static com.android.systemui.statusbar.NotificationEntryHelper.modifyRanking;
|
import static com.android.systemui.statusbar.NotificationEntryHelper.modifyRanking;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
import static com.google.common.truth.Truth.assertWithMessage;
|
||||||
|
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.reset;
|
import static org.mockito.Mockito.reset;
|
||||||
@@ -793,47 +794,48 @@ public class BubbleDataTest extends SysuiTestCase {
|
|||||||
|
|
||||||
private void assertBubbleAdded(Bubble expected) {
|
private void assertBubbleAdded(Bubble expected) {
|
||||||
BubbleData.Update update = mUpdateCaptor.getValue();
|
BubbleData.Update update = mUpdateCaptor.getValue();
|
||||||
assertThat(update.addedBubble).named("addedBubble").isEqualTo(expected);
|
assertWithMessage("addedBubble").that(update.addedBubble).isEqualTo(expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertBubbleRemoved(Bubble expected, @BubbleController.DismissReason int reason) {
|
private void assertBubbleRemoved(Bubble expected, @BubbleController.DismissReason int reason) {
|
||||||
BubbleData.Update update = mUpdateCaptor.getValue();
|
BubbleData.Update update = mUpdateCaptor.getValue();
|
||||||
assertThat(update.removedBubbles).named("removedBubbles")
|
assertWithMessage("removedBubbles").that(update.removedBubbles)
|
||||||
.isEqualTo(ImmutableList.of(Pair.create(expected, reason)));
|
.isEqualTo(ImmutableList.of(Pair.create(expected, reason)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertOrderNotChanged() {
|
private void assertOrderNotChanged() {
|
||||||
BubbleData.Update update = mUpdateCaptor.getValue();
|
BubbleData.Update update = mUpdateCaptor.getValue();
|
||||||
assertThat(update.orderChanged).named("orderChanged").isFalse();
|
assertWithMessage("orderChanged").that(update.orderChanged).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertOrderChangedTo(Bubble... order) {
|
private void assertOrderChangedTo(Bubble... order) {
|
||||||
BubbleData.Update update = mUpdateCaptor.getValue();
|
BubbleData.Update update = mUpdateCaptor.getValue();
|
||||||
assertThat(update.orderChanged).named("orderChanged").isTrue();
|
assertWithMessage("orderChanged").that(update.orderChanged).isTrue();
|
||||||
assertThat(update.bubbles).named("bubble order").isEqualTo(ImmutableList.copyOf(order));
|
assertWithMessage("bubble order").that(update.bubbles)
|
||||||
|
.isEqualTo(ImmutableList.copyOf(order));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertSelectionNotChanged() {
|
private void assertSelectionNotChanged() {
|
||||||
BubbleData.Update update = mUpdateCaptor.getValue();
|
BubbleData.Update update = mUpdateCaptor.getValue();
|
||||||
assertThat(update.selectionChanged).named("selectionChanged").isFalse();
|
assertWithMessage("selectionChanged").that(update.selectionChanged).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertSelectionChangedTo(Bubble bubble) {
|
private void assertSelectionChangedTo(Bubble bubble) {
|
||||||
BubbleData.Update update = mUpdateCaptor.getValue();
|
BubbleData.Update update = mUpdateCaptor.getValue();
|
||||||
assertThat(update.selectionChanged).named("selectionChanged").isTrue();
|
assertWithMessage("selectionChanged").that(update.selectionChanged).isTrue();
|
||||||
assertThat(update.selectedBubble).named("selectedBubble").isEqualTo(bubble);
|
assertWithMessage("selectedBubble").that(update.selectedBubble).isEqualTo(bubble);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertSelectionCleared() {
|
private void assertSelectionCleared() {
|
||||||
BubbleData.Update update = mUpdateCaptor.getValue();
|
BubbleData.Update update = mUpdateCaptor.getValue();
|
||||||
assertThat(update.selectionChanged).named("selectionChanged").isTrue();
|
assertWithMessage("selectionChanged").that(update.selectionChanged).isTrue();
|
||||||
assertThat(update.selectedBubble).named("selectedBubble").isNull();
|
assertWithMessage("selectedBubble").that(update.selectedBubble).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertExpandedChangedTo(boolean expected) {
|
private void assertExpandedChangedTo(boolean expected) {
|
||||||
BubbleData.Update update = mUpdateCaptor.getValue();
|
BubbleData.Update update = mUpdateCaptor.getValue();
|
||||||
assertThat(update.expandedChanged).named("expandedChanged").isTrue();
|
assertWithMessage("expandedChanged").that(update.expandedChanged).isTrue();
|
||||||
assertThat(update.expanded).named("expanded").isEqualTo(expected);
|
assertWithMessage("expanded").that(update.expanded).isEqualTo(expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertOverflowChangedTo(ImmutableList<Bubble> bubbles) {
|
private void assertOverflowChangedTo(ImmutableList<Bubble> bubbles) {
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ class MediaArtworkProcessorTest : SysuiTestCase() {
|
|||||||
val background2 = processor.processArtwork(context, artwork)!!
|
val background2 = processor.processArtwork(context, artwork)!!
|
||||||
// THEN the two bitmaps are the same
|
// THEN the two bitmaps are the same
|
||||||
// Note: This is currently broken and trying to use caching causes issues
|
// Note: This is currently broken and trying to use caching causes issues
|
||||||
assertThat(background1).isNotSameAs(background2)
|
assertThat(background1).isNotSameInstanceAs(background2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ class PeopleHubViewControllerTest : SysuiTestCase() {
|
|||||||
val people = viewModel.people.toList()
|
val people = viewModel.people.toList()
|
||||||
assertThat(people.size).isEqualTo(1)
|
assertThat(people.size).isEqualTo(1)
|
||||||
assertThat(people[0].name).isEqualTo("name")
|
assertThat(people[0].name).isEqualTo("name")
|
||||||
assertThat(people[0].icon).isSameAs(fakePerson.avatar)
|
assertThat(people[0].icon).isSameInstanceAs(fakePerson.avatar)
|
||||||
|
|
||||||
people[0].onClick()
|
people[0].onClick()
|
||||||
|
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
|||||||
mAccessibiltyDelegate.onInitializeAccessibilityNodeInfo(mView, nodeInfo);
|
mAccessibiltyDelegate.onInitializeAccessibilityNodeInfo(mView, nodeInfo);
|
||||||
|
|
||||||
List<AccessibilityNodeInfo.AccessibilityAction> actionList = nodeInfo.getActionList();
|
List<AccessibilityNodeInfo.AccessibilityAction> actionList = nodeInfo.getActionList();
|
||||||
assertThat(actionList).containsAllIn(
|
assertThat(actionList).containsAtLeastElementsIn(
|
||||||
new AccessibilityNodeInfo.AccessibilityAction[] {
|
new AccessibilityNodeInfo.AccessibilityAction[] {
|
||||||
AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD,
|
AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD,
|
||||||
AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_UP}
|
AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_UP}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import static com.android.server.backup.testing.Utils.oneTimeIterable;
|
|||||||
import static com.android.server.backup.testing.Utils.transferStreamedData;
|
import static com.android.server.backup.testing.Utils.transferStreamedData;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
import static com.google.common.truth.Truth.assertWithMessage;
|
||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.ArgumentMatchers.anyInt;
|
import static org.mockito.ArgumentMatchers.anyInt;
|
||||||
@@ -2814,8 +2815,8 @@ public class KeyValueBackupTaskTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static IterableSubject assertDirectory(Path directory) throws IOException {
|
private static IterableSubject assertDirectory(Path directory) throws IOException {
|
||||||
return assertThat(oneTimeIterable(Files.newDirectoryStream(directory).iterator()))
|
return assertWithMessage("directory " + directory).that(
|
||||||
.named("directory " + directory);
|
oneTimeIterable(Files.newDirectoryStream(directory).iterator()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void assertJournalDoesNotContain(
|
private static void assertJournalDoesNotContain(
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package com.android.server.backup.testing;
|
package com.android.server.backup.testing;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
import static com.google.common.truth.Truth.assertWithMessage;
|
||||||
|
|
||||||
import static org.robolectric.Shadows.shadowOf;
|
import static org.robolectric.Shadows.shadowOf;
|
||||||
|
|
||||||
@@ -95,8 +96,8 @@ public class TestUtils {
|
|||||||
* logcat before that.
|
* logcat before that.
|
||||||
*/
|
*/
|
||||||
public static void assertLogcatAtMost(String tag, int level) {
|
public static void assertLogcatAtMost(String tag, int level) {
|
||||||
assertThat(ShadowLog.getLogsForTag(tag).stream().allMatch(logItem -> logItem.type <= level))
|
assertWithMessage("All logs <= " + level).that(
|
||||||
.named("All logs <= " + level)
|
ShadowLog.getLogsForTag(tag).stream().allMatch(logItem -> logItem.type <= level))
|
||||||
.isTrue();
|
.isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,8 +106,8 @@ public class TestUtils {
|
|||||||
* logcat before that.
|
* logcat before that.
|
||||||
*/
|
*/
|
||||||
public static void assertLogcatAtLeast(String tag, int level) {
|
public static void assertLogcatAtLeast(String tag, int level) {
|
||||||
assertThat(ShadowLog.getLogsForTag(tag).stream().anyMatch(logItem -> logItem.type >= level))
|
assertWithMessage("Any log >= " + level).that(
|
||||||
.named("Any log >= " + level)
|
ShadowLog.getLogsForTag(tag).stream().anyMatch(logItem -> logItem.type >= level))
|
||||||
.isTrue();
|
.isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,11 +122,10 @@ public class TestUtils {
|
|||||||
* that uses logcat before that.
|
* that uses logcat before that.
|
||||||
*/
|
*/
|
||||||
public static void assertLogcat(String tag, int... logs) {
|
public static void assertLogcat(String tag, int... logs) {
|
||||||
assertThat(
|
assertWithMessage("Log items (specified per level)").that(
|
||||||
ShadowLog.getLogsForTag(tag).stream()
|
ShadowLog.getLogsForTag(tag).stream()
|
||||||
.map(logItem -> logItem.type)
|
.map(logItem -> logItem.type)
|
||||||
.collect(toSet()))
|
.collect(toSet()))
|
||||||
.named("Log items (specified per level)")
|
|
||||||
.containsExactly(IntStream.of(logs).boxed().toArray());
|
.containsExactly(IntStream.of(logs).boxed().toArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,15 +135,13 @@ public class TestUtils {
|
|||||||
|
|
||||||
/** Declare shadow {@link ShadowEventLog} to use this. */
|
/** Declare shadow {@link ShadowEventLog} to use this. */
|
||||||
public static void assertEventLogged(int tag, Object... values) {
|
public static void assertEventLogged(int tag, Object... values) {
|
||||||
assertThat(ShadowEventLog.getEntries())
|
assertWithMessage("Event logs").that(ShadowEventLog.getEntries())
|
||||||
.named("Event logs")
|
|
||||||
.contains(new ShadowEventLog.Entry(tag, Arrays.asList(values)));
|
.contains(new ShadowEventLog.Entry(tag, Arrays.asList(values)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Declare shadow {@link ShadowEventLog} to use this. */
|
/** Declare shadow {@link ShadowEventLog} to use this. */
|
||||||
public static void assertEventNotLogged(int tag, Object... values) {
|
public static void assertEventNotLogged(int tag, Object... values) {
|
||||||
assertThat(ShadowEventLog.getEntries())
|
assertWithMessage("Event logs").that(ShadowEventLog.getEntries())
|
||||||
.named("Event logs")
|
|
||||||
.doesNotContain(new ShadowEventLog.Entry(tag, Arrays.asList(values)));
|
.doesNotContain(new ShadowEventLog.Entry(tag, Arrays.asList(values)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class LocationFudgerTest {
|
|||||||
Location coarse = mFudger.createCoarse(fine);
|
Location coarse = mFudger.createCoarse(fine);
|
||||||
|
|
||||||
assertThat(coarse).isNotNull();
|
assertThat(coarse).isNotNull();
|
||||||
assertThat(coarse).isNotSameAs(fine);
|
assertThat(coarse).isNotSameInstanceAs(fine);
|
||||||
assertThat(coarse.hasBearing()).isFalse();
|
assertThat(coarse.hasBearing()).isFalse();
|
||||||
assertThat(coarse.hasSpeed()).isFalse();
|
assertThat(coarse.hasSpeed()).isFalse();
|
||||||
assertThat(coarse.hasAltitude()).isFalse();
|
assertThat(coarse.hasAltitude()).isFalse();
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ public class IntegrityFileManagerTest {
|
|||||||
assertThat(rulesFetched.size())
|
assertThat(rulesFetched.size())
|
||||||
.isEqualTo(INDEXING_BLOCK_SIZE * 2 + unindexedRuleCount);
|
.isEqualTo(INDEXING_BLOCK_SIZE * 2 + unindexedRuleCount);
|
||||||
assertThat(rulesFetched)
|
assertThat(rulesFetched)
|
||||||
.containsAllOf(
|
.containsAtLeast(
|
||||||
getPackageNameIndexedRule(installedPackageName),
|
getPackageNameIndexedRule(installedPackageName),
|
||||||
getAppCertificateIndexedRule(installedAppCertificate));
|
getAppCertificateIndexedRule(installedAppCertificate));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class TestOnlyInsecureCertificateHelperTest {
|
|||||||
Map<String, Pair<SecretKey, byte[]>> filteredKeys =
|
Map<String, Pair<SecretKey, byte[]>> filteredKeys =
|
||||||
mHelper.keepOnlyWhitelistedInsecureKeys(rawKeys);
|
mHelper.keepOnlyWhitelistedInsecureKeys(rawKeys);
|
||||||
assertThat(filteredKeys.entrySet()).containsExactlyElementsIn(expectedResult.entrySet());
|
assertThat(filteredKeys.entrySet()).containsExactlyElementsIn(expectedResult.entrySet());
|
||||||
assertThat(filteredKeys.entrySet()).containsAllIn(rawKeys.entrySet());
|
assertThat(filteredKeys.entrySet()).containsAtLeastElementsIn(rawKeys.entrySet());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -85,7 +85,7 @@ public class TestOnlyInsecureCertificateHelperTest {
|
|||||||
Map<String, Pair<SecretKey, byte[]>> filteredKeys =
|
Map<String, Pair<SecretKey, byte[]>> filteredKeys =
|
||||||
mHelper.keepOnlyWhitelistedInsecureKeys(rawKeys);
|
mHelper.keepOnlyWhitelistedInsecureKeys(rawKeys);
|
||||||
assertThat(filteredKeys.entrySet()).containsExactlyElementsIn(expectedResult.entrySet());
|
assertThat(filteredKeys.entrySet()).containsExactlyElementsIn(expectedResult.entrySet());
|
||||||
assertThat(rawKeys.entrySet()).containsAllIn(filteredKeys.entrySet());
|
assertThat(rawKeys.entrySet()).containsAtLeastElementsIn(filteredKeys.entrySet());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -100,7 +100,7 @@ public class TestOnlyInsecureCertificateHelperTest {
|
|||||||
Map<String, Pair<SecretKey, byte[]>> filteredKeys =
|
Map<String, Pair<SecretKey, byte[]>> filteredKeys =
|
||||||
mHelper.keepOnlyWhitelistedInsecureKeys(rawKeys);
|
mHelper.keepOnlyWhitelistedInsecureKeys(rawKeys);
|
||||||
assertThat(filteredKeys.entrySet()).containsExactlyElementsIn(expectedResult.entrySet());
|
assertThat(filteredKeys.entrySet()).containsExactlyElementsIn(expectedResult.entrySet());
|
||||||
assertThat(rawKeys.entrySet()).containsAllIn(filteredKeys.entrySet());
|
assertThat(rawKeys.entrySet()).containsAtLeastElementsIn(filteredKeys.entrySet());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -122,7 +122,7 @@ public class TestOnlyInsecureCertificateHelperTest {
|
|||||||
Map<String, Pair<SecretKey, byte[]>> filteredKeys =
|
Map<String, Pair<SecretKey, byte[]>> filteredKeys =
|
||||||
mHelper.keepOnlyWhitelistedInsecureKeys(rawKeys);
|
mHelper.keepOnlyWhitelistedInsecureKeys(rawKeys);
|
||||||
assertThat(filteredKeys.entrySet()).containsExactlyElementsIn(expectedResult.entrySet());
|
assertThat(filteredKeys.entrySet()).containsExactlyElementsIn(expectedResult.entrySet());
|
||||||
assertThat(rawKeys.entrySet()).containsAllIn(filteredKeys.entrySet());
|
assertThat(rawKeys.entrySet()).containsAtLeastElementsIn(filteredKeys.entrySet());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public final class CertXmlTest {
|
|||||||
CertXml certXml = CertXml.parse(certXmlBytes);
|
CertXml certXml = CertXml.parse(certXmlBytes);
|
||||||
List<X509Certificate> endpointCerts = certXml.getAllEndpointCerts();
|
List<X509Certificate> endpointCerts = certXml.getAllEndpointCerts();
|
||||||
assertThat(endpointCerts).hasSize(3);
|
assertThat(endpointCerts).hasSize(3);
|
||||||
assertThat(endpointCerts).containsAllOf(TestData.LEAF_CERT_1, TestData.LEAF_CERT_2);
|
assertThat(endpointCerts).containsAtLeast(TestData.LEAF_CERT_1, TestData.LEAF_CERT_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -639,7 +639,7 @@ public final class UserManagerTest {
|
|||||||
UserInfo user1 = createUser("User 1", 0);
|
UserInfo user1 = createUser("User 1", 0);
|
||||||
UserInfo user2 = createUser("User 2", 0);
|
UserInfo user2 = createUser("User 2", 0);
|
||||||
long[] serialNumbersOfUsers = mUserManager.getSerialNumbersOfUsers(false);
|
long[] serialNumbersOfUsers = mUserManager.getSerialNumbersOfUsers(false);
|
||||||
assertThat(serialNumbersOfUsers).asList().containsAllOf(
|
assertThat(serialNumbersOfUsers).asList().containsAtLeast(
|
||||||
(long) user1.serialNumber, (long) user2.serialNumber);
|
(long) user1.serialNumber, (long) user2.serialNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,41 +48,25 @@ public class RollbackStoreTest {
|
|||||||
private static final String INSTALLER = "some.installer";
|
private static final String INSTALLER = "some.installer";
|
||||||
|
|
||||||
private static final Correspondence<VersionedPackage, VersionedPackage> VER_PKG_CORR =
|
private static final Correspondence<VersionedPackage, VersionedPackage> VER_PKG_CORR =
|
||||||
new Correspondence<VersionedPackage, VersionedPackage>() {
|
Correspondence.from((VersionedPackage a, VersionedPackage b) -> {
|
||||||
@Override
|
|
||||||
public boolean compare(VersionedPackage a, VersionedPackage b) {
|
|
||||||
if (a == null || b == null) {
|
if (a == null || b == null) {
|
||||||
return a == b;
|
return a == b;
|
||||||
}
|
}
|
||||||
return a.equals(b);
|
return a.equals(b);
|
||||||
}
|
}, "is the same as");
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "is the same as";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private static final Correspondence<PackageRollbackInfo.RestoreInfo,
|
private static final Correspondence<PackageRollbackInfo.RestoreInfo,
|
||||||
PackageRollbackInfo.RestoreInfo>
|
PackageRollbackInfo.RestoreInfo>
|
||||||
RESTORE_INFO_CORR =
|
RESTORE_INFO_CORR =
|
||||||
new Correspondence<PackageRollbackInfo.RestoreInfo, PackageRollbackInfo.RestoreInfo>() {
|
Correspondence.from((PackageRollbackInfo.RestoreInfo a,
|
||||||
@Override
|
PackageRollbackInfo.RestoreInfo b) -> {
|
||||||
public boolean compare(PackageRollbackInfo.RestoreInfo a,
|
|
||||||
PackageRollbackInfo.RestoreInfo b) {
|
|
||||||
if (a == null || b == null) {
|
if (a == null || b == null) {
|
||||||
return a == b;
|
return a == b;
|
||||||
}
|
}
|
||||||
return a.userId == b.userId
|
return a.userId == b.userId
|
||||||
&& a.appId == b.appId
|
&& a.appId == b.appId
|
||||||
&& Objects.equals(a.seInfo, b.seInfo);
|
&& Objects.equals(a.seInfo, b.seInfo);
|
||||||
}
|
}, "is the same as");
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "is the same as";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private static final String JSON_ROLLBACK_NO_EXT = "{'info':{'rollbackId':123,'packages':"
|
private static final String JSON_ROLLBACK_NO_EXT = "{'info':{'rollbackId':123,'packages':"
|
||||||
+ "[{'versionRolledBackFrom':{'packageName':'blah','longVersionCode':55},"
|
+ "[{'versionRolledBackFrom':{'packageName':'blah','longVersionCode':55},"
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ public class DiskStatsFileLoggerTest extends AndroidTestCase {
|
|||||||
appSizes.getLong(i), cacheSizes.getLong(i));
|
appSizes.getLong(i), cacheSizes.getLong(i));
|
||||||
apps.add(app);
|
apps.add(app);
|
||||||
}
|
}
|
||||||
assertThat(apps).containsAllOf(new AppSizeGrouping("com.test.app", 1100, 20),
|
assertThat(apps).containsAtLeast(new AppSizeGrouping("com.test.app", 1100, 20),
|
||||||
new AppSizeGrouping("com.test.app2", 11, 2));
|
new AppSizeGrouping("com.test.app2", 11, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,9 +81,7 @@ public class TunerResourceManagerServiceTest {
|
|||||||
|
|
||||||
// A correspondence to compare a FrontendResource and a TunerFrontendInfo.
|
// A correspondence to compare a FrontendResource and a TunerFrontendInfo.
|
||||||
private static final Correspondence<FrontendResource, TunerFrontendInfo> FR_TFI_COMPARE =
|
private static final Correspondence<FrontendResource, TunerFrontendInfo> FR_TFI_COMPARE =
|
||||||
new Correspondence<FrontendResource, TunerFrontendInfo>() {
|
Correspondence.from((FrontendResource actual, TunerFrontendInfo expected) -> {
|
||||||
@Override
|
|
||||||
public boolean compare(FrontendResource actual, TunerFrontendInfo expected) {
|
|
||||||
if (actual == null || expected == null) {
|
if (actual == null || expected == null) {
|
||||||
return (actual == null) && (expected == null);
|
return (actual == null) && (expected == null);
|
||||||
}
|
}
|
||||||
@@ -91,13 +89,7 @@ public class TunerResourceManagerServiceTest {
|
|||||||
return actual.getId() == expected.getId()
|
return actual.getId() == expected.getId()
|
||||||
&& actual.getType() == expected.getFrontendType()
|
&& actual.getType() == expected.getFrontendType()
|
||||||
&& actual.getExclusiveGroupId() == expected.getExclusiveGroupId();
|
&& actual.getExclusiveGroupId() == expected.getExclusiveGroupId();
|
||||||
}
|
}, "is correctly configured from ");
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "is correctly configured from ";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
|
|||||||
@@ -305,6 +305,7 @@ public class ShortcutHelperTest extends UiServiceTestCase {
|
|||||||
//when(mShortcutServiceInternal.isSharingShortcut(anyInt(), anyString(), anyString(),
|
//when(mShortcutServiceInternal.isSharingShortcut(anyInt(), anyString(), anyString(),
|
||||||
// anyString(), anyInt(), any())).thenReturn(true);
|
// anyString(), anyInt(), any())).thenReturn(true);
|
||||||
|
|
||||||
assertThat(mShortcutHelper.getValidShortcutInfo("a", "p", UserHandle.SYSTEM)).isSameAs(si);
|
assertThat(mShortcutHelper.getValidShortcutInfo("a", "p", UserHandle.SYSTEM))
|
||||||
|
.isSameInstanceAs(si);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ class ParcelablesTest<T : Parcelable>(private val inputData: InputData<T>) {
|
|||||||
data class InputData<T : Parcelable>(val valid: T, val validCopy: T, val validOther: T) {
|
data class InputData<T : Parcelable>(val valid: T, val validCopy: T, val validOther: T) {
|
||||||
val kls = valid.javaClass
|
val kls = valid.javaClass
|
||||||
init {
|
init {
|
||||||
assertThat(valid).isNotSameAs(validCopy)
|
assertThat(valid).isNotSameInstanceAs(validCopy)
|
||||||
// Don't use isInstanceOf because of phantom warnings in intellij about Class!
|
// Don't use isInstanceOf because of phantom warnings in intellij about Class!
|
||||||
assertThat(validCopy.javaClass).isEqualTo(valid.javaClass)
|
assertThat(validCopy.javaClass).isEqualTo(valid.javaClass)
|
||||||
assertThat(validOther.javaClass).isEqualTo(valid.javaClass)
|
assertThat(validOther.javaClass).isEqualTo(valid.javaClass)
|
||||||
|
|||||||
@@ -80,12 +80,12 @@ public class SoftApConfigurationTest {
|
|||||||
assertThat(original.getMaxNumberOfClients()).isEqualTo(0);
|
assertThat(original.getMaxNumberOfClients()).isEqualTo(0);
|
||||||
|
|
||||||
SoftApConfiguration unparceled = parcelUnparcel(original);
|
SoftApConfiguration unparceled = parcelUnparcel(original);
|
||||||
assertThat(unparceled).isNotSameAs(original);
|
assertThat(unparceled).isNotSameInstanceAs(original);
|
||||||
assertThat(unparceled).isEqualTo(original);
|
assertThat(unparceled).isEqualTo(original);
|
||||||
assertThat(unparceled.hashCode()).isEqualTo(original.hashCode());
|
assertThat(unparceled.hashCode()).isEqualTo(original.hashCode());
|
||||||
|
|
||||||
SoftApConfiguration copy = new SoftApConfiguration.Builder(original).build();
|
SoftApConfiguration copy = new SoftApConfiguration.Builder(original).build();
|
||||||
assertThat(copy).isNotSameAs(original);
|
assertThat(copy).isNotSameInstanceAs(original);
|
||||||
assertThat(copy).isEqualTo(original);
|
assertThat(copy).isEqualTo(original);
|
||||||
assertThat(copy.hashCode()).isEqualTo(original.hashCode());
|
assertThat(copy.hashCode()).isEqualTo(original.hashCode());
|
||||||
}
|
}
|
||||||
@@ -104,12 +104,12 @@ public class SoftApConfigurationTest {
|
|||||||
assertThat(original.getMaxNumberOfClients()).isEqualTo(0);
|
assertThat(original.getMaxNumberOfClients()).isEqualTo(0);
|
||||||
|
|
||||||
SoftApConfiguration unparceled = parcelUnparcel(original);
|
SoftApConfiguration unparceled = parcelUnparcel(original);
|
||||||
assertThat(unparceled).isNotSameAs(original);
|
assertThat(unparceled).isNotSameInstanceAs(original);
|
||||||
assertThat(unparceled).isEqualTo(original);
|
assertThat(unparceled).isEqualTo(original);
|
||||||
assertThat(unparceled.hashCode()).isEqualTo(original.hashCode());
|
assertThat(unparceled.hashCode()).isEqualTo(original.hashCode());
|
||||||
|
|
||||||
SoftApConfiguration copy = new SoftApConfiguration.Builder(original).build();
|
SoftApConfiguration copy = new SoftApConfiguration.Builder(original).build();
|
||||||
assertThat(copy).isNotSameAs(original);
|
assertThat(copy).isNotSameInstanceAs(original);
|
||||||
assertThat(copy).isEqualTo(original);
|
assertThat(copy).isEqualTo(original);
|
||||||
assertThat(copy.hashCode()).isEqualTo(original.hashCode());
|
assertThat(copy.hashCode()).isEqualTo(original.hashCode());
|
||||||
}
|
}
|
||||||
@@ -145,12 +145,12 @@ public class SoftApConfigurationTest {
|
|||||||
assertThat(original.getAllowedClientList()).isEqualTo(testAllowedClientList);
|
assertThat(original.getAllowedClientList()).isEqualTo(testAllowedClientList);
|
||||||
|
|
||||||
SoftApConfiguration unparceled = parcelUnparcel(original);
|
SoftApConfiguration unparceled = parcelUnparcel(original);
|
||||||
assertThat(unparceled).isNotSameAs(original);
|
assertThat(unparceled).isNotSameInstanceAs(original);
|
||||||
assertThat(unparceled).isEqualTo(original);
|
assertThat(unparceled).isEqualTo(original);
|
||||||
assertThat(unparceled.hashCode()).isEqualTo(original.hashCode());
|
assertThat(unparceled.hashCode()).isEqualTo(original.hashCode());
|
||||||
|
|
||||||
SoftApConfiguration copy = new SoftApConfiguration.Builder(original).build();
|
SoftApConfiguration copy = new SoftApConfiguration.Builder(original).build();
|
||||||
assertThat(copy).isNotSameAs(original);
|
assertThat(copy).isNotSameInstanceAs(original);
|
||||||
assertThat(copy).isEqualTo(original);
|
assertThat(copy).isEqualTo(original);
|
||||||
assertThat(copy.hashCode()).isEqualTo(original.hashCode());
|
assertThat(copy.hashCode()).isEqualTo(original.hashCode());
|
||||||
}
|
}
|
||||||
@@ -171,12 +171,12 @@ public class SoftApConfigurationTest {
|
|||||||
|
|
||||||
|
|
||||||
SoftApConfiguration unparceled = parcelUnparcel(original);
|
SoftApConfiguration unparceled = parcelUnparcel(original);
|
||||||
assertThat(unparceled).isNotSameAs(original);
|
assertThat(unparceled).isNotSameInstanceAs(original);
|
||||||
assertThat(unparceled).isEqualTo(original);
|
assertThat(unparceled).isEqualTo(original);
|
||||||
assertThat(unparceled.hashCode()).isEqualTo(original.hashCode());
|
assertThat(unparceled.hashCode()).isEqualTo(original.hashCode());
|
||||||
|
|
||||||
SoftApConfiguration copy = new SoftApConfiguration.Builder(original).build();
|
SoftApConfiguration copy = new SoftApConfiguration.Builder(original).build();
|
||||||
assertThat(copy).isNotSameAs(original);
|
assertThat(copy).isNotSameInstanceAs(original);
|
||||||
assertThat(copy).isEqualTo(original);
|
assertThat(copy).isEqualTo(original);
|
||||||
assertThat(copy.hashCode()).isEqualTo(original.hashCode());
|
assertThat(copy.hashCode()).isEqualTo(original.hashCode());
|
||||||
}
|
}
|
||||||
@@ -198,12 +198,12 @@ public class SoftApConfigurationTest {
|
|||||||
|
|
||||||
|
|
||||||
SoftApConfiguration unparceled = parcelUnparcel(original);
|
SoftApConfiguration unparceled = parcelUnparcel(original);
|
||||||
assertThat(unparceled).isNotSameAs(original);
|
assertThat(unparceled).isNotSameInstanceAs(original);
|
||||||
assertThat(unparceled).isEqualTo(original);
|
assertThat(unparceled).isEqualTo(original);
|
||||||
assertThat(unparceled.hashCode()).isEqualTo(original.hashCode());
|
assertThat(unparceled.hashCode()).isEqualTo(original.hashCode());
|
||||||
|
|
||||||
SoftApConfiguration copy = new SoftApConfiguration.Builder(original).build();
|
SoftApConfiguration copy = new SoftApConfiguration.Builder(original).build();
|
||||||
assertThat(copy).isNotSameAs(original);
|
assertThat(copy).isNotSameInstanceAs(original);
|
||||||
assertThat(copy).isEqualTo(original);
|
assertThat(copy).isEqualTo(original);
|
||||||
assertThat(copy.hashCode()).isEqualTo(original.hashCode());
|
assertThat(copy.hashCode()).isEqualTo(original.hashCode());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user