Use Paramatized class for MicrodroidTestAppNoPerm

Fix up the class used for the test.

Bug: 323448288
Bug: 322197421
Test: atest MicrodroidTestAppNoPerm

Merged-In: Ia0259a9d36b5acdc07cb4bfe75cffcd14f84716f
Merged-In: I7bb80550298e94807e57738d1b2561a761b684ef
Change-Id: I7bb80550298e94807e57738d1b2561a761b684ef
Signed-off-by: David Dai <davidai@google.com>
diff --git a/tests/testapk_no_perm/src/java/com/android/microdroid/test/MicrodroidTestAppNoPerm.java b/tests/testapk_no_perm/src/java/com/android/microdroid/test/MicrodroidTestAppNoPerm.java
index a50517f..539f344 100644
--- a/tests/testapk_no_perm/src/java/com/android/microdroid/test/MicrodroidTestAppNoPerm.java
+++ b/tests/testapk_no_perm/src/java/com/android/microdroid/test/MicrodroidTestAppNoPerm.java
@@ -19,6 +19,7 @@
 import android.system.virtualmachine.VirtualMachineConfig;
 
 import com.android.compatibility.common.util.CddTest;
+import com.android.compatibility.common.util.ApiTest;
 import com.android.microdroid.test.device.MicrodroidDeviceTestBase;
 
 import static com.google.common.truth.Truth.assertThat;
@@ -26,15 +27,14 @@
 
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.runners.Parameterized;
 import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
+import org.junit.runners.Parameterized;
 
 /**
  * Test that the android.permission.MANAGE_VIRTUAL_MACHINE is enforced and that an app cannot launch
  * a VM without said permission.
  */
-@RunWith(JUnit4.class)
+@RunWith(Parameterized.class)
 public class MicrodroidTestAppNoPerm extends MicrodroidDeviceTestBase {
     @Parameterized.Parameters(name = "protectedVm={0}")
     public static Object[] protectedVmConfigs() {
@@ -55,6 +55,7 @@
                 "9.17/C-1-2",
                 "9.17/C-1-4",
             })
+    @ApiTest(apis = {"android.system.virtualmachine.VirtualMachineManager#RequiresPermission"})
     public void createVmRequiresPermission() {
         assumeSupportedDevice();