From 12600adfa33479782d42f0d6ff2dc0fd6f4a1278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=A4nge?= Date: Tue, 23 Jan 2024 12:14:16 +0100 Subject: [PATCH] Fix `ApplicationTest.java` --- app/build.gradle | 3 +++ .../ApplicationTest.java | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d126c12..f370db9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -71,6 +71,9 @@ dependencies { implementation 'com.github.PhilJay:MPAndroidChart:v3.0.0-beta1' implementation 'androidx.multidex:multidex:2.0.1' //with androidx libraries + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test:runner:1.5.2' + def work_version = '2.9.0' implementation "androidx.work:work-runtime:$work_version" implementation "androidx.work:work-runtime-ktx:$work_version" diff --git a/app/src/androidTest/java/org/secuso/privacyfriendlyactivitytracker/ApplicationTest.java b/app/src/androidTest/java/org/secuso/privacyfriendlyactivitytracker/ApplicationTest.java index 31a9674..4fbe8bb 100644 --- a/app/src/androidTest/java/org/secuso/privacyfriendlyactivitytracker/ApplicationTest.java +++ b/app/src/androidTest/java/org/secuso/privacyfriendlyactivitytracker/ApplicationTest.java @@ -1,13 +1,20 @@ package org.secuso.privacyfriendlyactivitytracker; -import android.app.Application; -import android.test.ApplicationTestCase; +import static junit.framework.TestCase.assertEquals; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; /** * Testing Fundamentals */ -public class ApplicationTest extends ApplicationTestCase { - public ApplicationTest() { - super(Application.class); +@RunWith(AndroidJUnit4.class) +public class ApplicationTest { + @Test + public void instrumentationTest() throws Exception { + assertEquals("org.secuso.privacyfriendlyactivitytracker", InstrumentationRegistry.getInstrumentation().getTargetContext().getPackageName()); } } \ No newline at end of file