summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2020-05-19 00:22:57 +0200
committerArne Schwabe <arne@rfc2549.org>2020-05-19 00:22:57 +0200
commit45d8e94d3b8421018fa86a8ca1439210fedbd8de (patch)
treebe7a75b353aeb26f5179c9df201028e630884282
parent47ecc7c36a6a606965073c22a101e2b4695a53f3 (diff)
Update test dependencies
-rw-r--r--gradle.properties3
-rw-r--r--main/build.gradle.kts4
-rw-r--r--main/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java4
-rw-r--r--main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.kt3
4 files changed, 10 insertions, 4 deletions
diff --git a/gradle.properties b/gradle.properties
index d1397fb0..00f3339f 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -4,4 +4,5 @@
#
android.enableJetifier=true
-android.useAndroidX=true \ No newline at end of file
+android.useAndroidX=true
+android.enableUnitTestBinaryResources=true
diff --git a/main/build.gradle.kts b/main/build.gradle.kts
index 7c4fa61a..d95661e1 100644
--- a/main/build.gradle.kts
+++ b/main/build.gradle.kts
@@ -29,7 +29,8 @@ android {
}
}
- //testOptions.unitTests.isIncludeAndroidResources = true
+ testOptions.unitTests.isIncludeAndroidResources = true
+
externalNativeBuild {
@@ -187,4 +188,5 @@ dependencies {
testImplementation("junit:junit:4.13")
testImplementation("org.mockito:mockito-core:3.3.3")
testImplementation("org.robolectric:robolectric:4.3.1")
+ testImplementation("androidx.test:core:1.2.0")
}
diff --git a/main/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java b/main/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java
index 8a028218..91e90f86 100644
--- a/main/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java
+++ b/main/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java
@@ -7,6 +7,7 @@ package de.blinkt.openvpn.core;
import android.content.Context;
import android.content.pm.PackageManager;
+import android.os.Build;
import junit.framework.Assert;
@@ -25,7 +26,8 @@ import static de.blinkt.openvpn.VpnProfile.TYPE_USERPASS;
* Created by arne on 14.03.18.
*/
-@Config(manifest= Config.NONE)
+
+@Config(sdk = Build.VERSION_CODES.O_MR1)
@RunWith(RobolectricTestRunner.class)
public class TestConfigGenerator {
@Test
diff --git a/main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.kt b/main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.kt
index da887a0b..11d7092b 100644
--- a/main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.kt
+++ b/main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.kt
@@ -6,6 +6,7 @@
package de.blinkt.openvpn.core
import android.content.Context
+import android.os.Build
import androidx.test.core.app.ApplicationProvider
import de.blinkt.openvpn.R
import org.junit.Assert
@@ -44,8 +45,8 @@ const val fakeCerts = "<ca>\n" +
"</key>"
-@Config(manifest = "src/main/AndroidManifest.xml")
@RunWith(RobolectricTestRunner::class)
+@Config(sdk = [Build.VERSION_CODES.O_MR1])
class TestConfigParser {
@Test
@Throws(IOException::class, ConfigParser.ConfigParseError::class)