summaryrefslogtreecommitdiffhomepage
path: root/android/test
diff options
context:
space:
mode:
authorAlbin <albin@mullvad.net>2022-12-13 09:44:00 +0100
committerAlbin <albin@mullvad.net>2023-01-10 15:32:32 +0100
commitca8878aa238a5c8e3be1f326ce98e238ffe87388 (patch)
tree573df6eff8b272ef70beb533a30f6e244a86d27b /android/test
parentbd75bd3dd12080de4b8b4aa869fc41611a707533 (diff)
downloadmullvadvpn-ca8878aa238a5c8e3be1f326ce98e238ffe87388.tar.xz
mullvadvpn-ca8878aa238a5c8e3be1f326ce98e238ffe87388.zip
Add empty :test:mockapi project
Diffstat (limited to 'android/test')
-rw-r--r--android/test/mockapi/build.gradle.kts61
-rw-r--r--android/test/mockapi/mockapi-suppression.xml31
-rw-r--r--android/test/mockapi/src/main/AndroidManifest.xml7
3 files changed, 99 insertions, 0 deletions
diff --git a/android/test/mockapi/build.gradle.kts b/android/test/mockapi/build.gradle.kts
new file mode 100644
index 0000000000..84410e168f
--- /dev/null
+++ b/android/test/mockapi/build.gradle.kts
@@ -0,0 +1,61 @@
+plugins {
+ id(Dependencies.Plugin.androidTestId)
+ id(Dependencies.Plugin.kotlinAndroidId)
+}
+
+android {
+ namespace = "net.mullvad.mullvadvpn.test.mockapi"
+ compileSdk = Versions.Android.compileSdkVersion
+
+ defaultConfig {
+ minSdk = Versions.Android.minSdkVersion
+ targetSdk = Versions.Android.targetSdkVersion
+ testApplicationId = "net.mullvad.mullvadvpn.test.mockapi"
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ targetProjectPath = ":app"
+
+ testInstrumentationRunnerArguments.putAll(
+ mapOf(
+ "clearPackageData" to "true",
+ "useTestStorageService" to "true"
+ )
+ )
+ }
+
+ testOptions {
+ execution = "ANDROIDX_TEST_ORCHESTRATOR"
+ }
+
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+
+ kotlinOptions {
+ jvmTarget = Versions.jvmTarget
+ }
+}
+
+configure<org.owasp.dependencycheck.gradle.extension.DependencyCheckExtension> {
+ // Skip the lintClassPath configuration, which relies on many dependencies that has been flagged
+ // to have CVEs, as it's related to the lint tooling rather than the project's compilation class
+ // path. The alternative would be to suppress specific CVEs, however that could potentially
+ // result in suppressed CVEs in project compilation class path.
+ skipConfigurations = listOf("lintClassPath")
+ suppressionFile = "$projectDir/mockapi-suppression.xml"
+}
+
+dependencies {
+ implementation(project(Projects.testCommon))
+
+ implementation(Dependencies.AndroidX.testCore)
+ // Fixes: https://github.com/android/android-test/issues/1589
+ implementation(Dependencies.AndroidX.testMonitor)
+ implementation(Dependencies.AndroidX.testRunner)
+ implementation(Dependencies.AndroidX.testRules)
+ implementation(Dependencies.AndroidX.testUiAutomator)
+ implementation(Dependencies.Kotlin.stdlib)
+ implementation(Dependencies.mockkWebserver)
+
+ androidTestUtil(Dependencies.AndroidX.testOrchestrator)
+}
diff --git a/android/test/mockapi/mockapi-suppression.xml b/android/test/mockapi/mockapi-suppression.xml
new file mode 100644
index 0000000000..86e10bebb2
--- /dev/null
+++ b/android/test/mockapi/mockapi-suppression.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
+ <suppress>
+ <notes><![CDATA[
+ This CVE only affect Multiplatform Gradle Projects, which this project is not.
+ ]]></notes>
+ <cve>CVE-2022-24329</cve>
+ </suppress>
+ <suppress>
+ <notes><![CDATA[
+ This CVE is a false positive as the description refers to a GO library (github.com/containers/storage).
+ ]]></notes>
+ <packageUrl regex="true">^pkg:maven/androidx\.test\.services/storage@.*$</packageUrl>
+ <cve>CVE-2021-20291</cve>
+ </suppress>
+ <suppress>
+ <notes><![CDATA[
+ This CVE is a false positive as javalite isn't affected according to:
+ https://cloud.google.com/support/bulletins#gcp-2022-001
+ ]]></notes>
+ <packageUrl regex="true">^pkg:maven/com\.google\.protobuf/protobuf\-javalite@.*$</packageUrl>
+ <cve>CVE-2021-22569</cve>
+ </suppress>
+ <suppress>
+ <notes><![CDATA[
+ This CVE is tracked externally and is therefore suppressed in the automatic audit checks.
+ ]]></notes>
+ <packageUrl regex="true">^pkg:maven/com\.google\.protobuf/protobuf\-javalite@.*$</packageUrl>
+ <cve>CVE-2022-3171</cve>
+ </suppress>
+</suppressions>
diff --git a/android/test/mockapi/src/main/AndroidManifest.xml b/android/test/mockapi/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..931f79d291
--- /dev/null
+++ b/android/test/mockapi/src/main/AndroidManifest.xml
@@ -0,0 +1,7 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <uses-permission android:name="android.permission.INTERNET" />
+ <instrumentation
+ android:name="androidx.test.runner.AndroidJUnitRunner"
+ android:targetPackage="net.mullvad.mullvadvpn" />
+</manifest>