AccountManagerServiceTestFixtures.java revision 81c4c8af206624f902efbd913fc3b26bb6842307
1/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package com.android.server.accounts;
17
18import android.accounts.Account;
19
20import java.util.ArrayList;
21import java.util.List;
22
23/**
24 * Constants shared between test AccountAuthenticators and AccountManagerServiceTest.
25 */
26public final class AccountManagerServiceTestFixtures {
27    public static final String KEY_ACCOUNT_NAME = "account_manager_service_test:account_name_key";
28    public static final String KEY_ACCOUNT_SESSION_BUNDLE =
29            "account_manager_service_test:account_session_bundle_key";
30    public static final String KEY_ACCOUNT_STATUS_TOKEN =
31            "account_manager_service_test:account_status_token_key";
32    public static final String KEY_ACCOUNT_PASSWORD =
33            "account_manager_service_test:account_password_key";
34
35    public static final String ACCOUNT_NAME_SUCCESS = "success_on_return@fixture.com";
36    public static final String ACCOUNT_NAME_INTERVENE = "intervene@fixture.com";
37    public static final String ACCOUNT_NAME_ERROR = "error@fixture.com";
38
39    public static final String ACCOUNT_NAME =
40            "com.android.server.accounts.account_manager_service_test.account.name";
41    public static final String ACCOUNT_TYPE_1 =
42            "com.android.server.accounts.account_manager_service_test.account.type1";
43    public static final String ACCOUNT_TYPE_2 =
44            "com.android.server.accounts.account_manager_service_test.account.type2";
45    public static final String ACCOUNT_FAKE_TYPE =
46            "com.android.server.accounts.account_manager_service_test.account.type.fake";
47
48    public static final String ACCOUNT_STATUS_TOKEN =
49            "com.android.server.accounts.account_manager_service_test.account.status.token";
50
51    public static final String ACCOUNT_PASSWORD =
52            "com.android.server.accounts.account_manager_service_test.account.password";
53    public static final String KEY_RESULT = "account_manager_service_test:result";
54    public static final String KEY_CALLBACK = "account_manager_service_test:callback";
55
56    public static final Account ACCOUNT_SUCCESS =
57            new Account(ACCOUNT_NAME_SUCCESS, ACCOUNT_TYPE_1);
58    public static final Account ACCOUNT_INTERVENE =
59            new Account(ACCOUNT_NAME_INTERVENE, ACCOUNT_TYPE_1);
60    public static final Account ACCOUNT_ERROR =
61            new Account(ACCOUNT_NAME_ERROR, ACCOUNT_TYPE_1);
62
63    public static final String SESSION_DATA_NAME_1 = "session.data.name.1";
64    public static final String SESSION_DATA_VALUE_1 = "session.data.value.1";
65
66    public static final String ERROR_MESSAGE =
67        "com.android.server.accounts.account_manager_service_test.error.message";
68
69    private AccountManagerServiceTestFixtures() {}
70}