Skip to content

Commit

Permalink
init in func
Browse files Browse the repository at this point in the history
  • Loading branch information
SM2A committed Mar 23, 2024
1 parent d2dcfc1 commit 19069d2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
packages: 'tools platform-tools platforms;android-34'
#- name: Setup Android SDK
# uses: android-actions/setup-android@v3
# with:
# packages: 'tools platform-tools platforms;android-34'
- name: Install Bazel
run: |
sudo apt install apt-transport-https curl gnupg -y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import android.os.Build.VERSION_CODES;
import androidx.test.core.app.ApplicationProvider;
import org.junit.Test;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
Expand All @@ -38,9 +39,8 @@
@Config(minSdk = VERSION_CODES.Q)
public class PermissionsHelperTest {

private static final ComponentName TESTDPC_ADMIN =
new ComponentName("com.afwsamples.testdpc", "TestCls");
private static final ComponentName NON_TESTDPC_ADMIN = new ComponentName("TestPkg", "TestCls");
private static final ComponentName TESTDPC_ADMIN = null;
private static final ComponentName NON_TESTDPC_ADMIN = null;

private final Context mContext = ApplicationProvider.getApplicationContext();
private final DevicePolicyManager mDevicePolicyManager =
Expand All @@ -53,6 +53,12 @@ public class PermissionsHelperTest {
private static final String NORMAL_PERMISSION = permission.ACCESS_WIFI_STATE;
private static final String MISSING_INFO_PERMISSION = permission.CHANGE_WIFI_STATE;

@Before
public viod init() {
TESTDPC_ADMIN = new ComponentName("com.afwsamples.testdpc", "TestCls");
NON_TESTDPC_ADMIN = new ComponentName("TestPkg", "TestCls");
}

@Test
public void
ensureRequiredPermissions_ifPermissionMissingFromManifest_shouldReturnFalseAndLogError() {
Expand Down

0 comments on commit 19069d2

Please sign in to comment.