Home
last modified time | relevance | path

Searched refs:SyncAnswer (Results 1 – 3 of 3) sorted by relevance

/packages/services/Car/tests/carservice_unit_test/src/com/android/car/user/
DUserPreCreatorTest.java35 import android.car.test.mocks.SyncAnswer;
78 SyncAnswer<UserInfo> syncUserInfo = mockPreCreateUser(/* isGuest= */ false); in testPreCreatedUsersLessThanRequested()
93 SyncAnswer<UserInfo> syncUserInfo = mockPreCreateUser(/* isGuest= */ true); in testPreCreatedGuestsLessThanRequested()
108 SyncAnswer<Boolean> syncRemoveStatus = mockRemoveUser(PRE_CREATED_USER_ID); in testRemovePreCreatedUser()
122 SyncAnswer<Boolean> syncRemoveStatus = mockRemoveUser(PRE_CREATED_GUEST_ID); in testRemovePreCreatedGuest()
136 SyncAnswer<Boolean> syncRemoveStatus = mockRemoveUser(PRE_CREATED_USER_ID); in testRemoveInvalidPreCreatedUser()
165 private SyncAnswer<UserInfo> mockPreCreateUserException() { in mockPreCreateUserException()
166 SyncAnswer<UserInfo> syncException = SyncAnswer.forException(new Exception()); in mockPreCreateUserException()
198 private SyncAnswer<UserInfo> mockPreCreateUser(boolean isGuest) { in mockPreCreateUser()
201 SyncAnswer<UserInfo> syncUserInfo = SyncAnswer.forReturn(newUser); in mockPreCreateUser()
[all …]
/packages/services/Car/car-test-lib/src/android/car/test/mocks/
DSyncAnswer.java40 public final class SyncAnswer<T> implements Answer<T> { class
42 private static final String TAG = SyncAnswer.class.getSimpleName();
48 private SyncAnswer(T answer, Throwable exception) { in SyncAnswer() method in SyncAnswer
57 public static <T> SyncAnswer<T> forReturn(@NonNull T value) { in forReturn()
58 return new SyncAnswer<T>(value, /* exception= */ null); in forReturn()
65 public static <T> SyncAnswer<T> forException(@NonNull Throwable t) { in forException()
66 return new SyncAnswer<T>(/* value= */ null, t); in forException()
/packages/services/Car/tests/carservice_unit_test/src/android/car/test/mocks/
DSyncAnswerTest.java52 SyncAnswer<Boolean> syncException = SyncAnswer.forException(expected); in testForException()
64 SyncAnswer<Boolean> syncInitialized = SyncAnswer.forReturn(true); in testForReturn()