blob: 4d49649a50160ac1859045df782814378fa045c8 [file] [log] [blame]
Steve McKayc8889af2016-09-23 11:22:41 -07001/*
2 * Copyright (C) 2016 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 */
16
Steve McKayb6006b22016-09-29 09:23:45 -070017package com.android.documentsui.files;
18
19import com.android.documentsui.files.ActionHandler;
Garfield Tane9670332017-03-06 18:33:23 -080020import com.android.documentsui.testing.TestEnv;
Steve McKayc8889af2016-09-23 11:22:41 -070021
Steve McKayc8889af2016-09-23 11:22:41 -070022import org.mockito.Mockito;
23
Steve McKay988d8a32016-09-27 09:41:17 -070024public abstract class TestActivity extends AbstractBase {
Steve McKayc8889af2016-09-23 11:22:41 -070025
Garfield Tane9670332017-03-06 18:33:23 -080026 public static TestActivity create(TestEnv env) {
Steve McKay988d8a32016-09-27 09:41:17 -070027 TestActivity activity = Mockito.mock(TestActivity.class, Mockito.CALLS_REAL_METHODS);
Garfield Tane9670332017-03-06 18:33:23 -080028 activity.init(env);
Steve McKay988d8a32016-09-27 09:41:17 -070029 return activity;
Steve McKayc8889af2016-09-23 11:22:41 -070030 }
31}
Steve McKay988d8a32016-09-27 09:41:17 -070032
33// Trick Mockito into finding our Addons methods correctly. W/o this
34// hack, Mockito thinks Addons methods are not implemented.
35abstract class AbstractBase extends com.android.documentsui.TestActivity
36 implements ActionHandler.Addons {}