From 45d8e94d3b8421018fa86a8ca1439210fedbd8de Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 19 May 2020 00:22:57 +0200 Subject: Update test dependencies --- main/build.gradle.kts | 4 +++- main/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java | 4 +++- main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.kt | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'main') 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 = "\n" + "" -@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) -- cgit v1.2.3