From 390fa154b5c06ed3e587b6fee81a64bc0ce404b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Kr=C3=BCger?= Date: Tue, 7 Dec 2021 11:32:01 +0100 Subject: [PATCH] Fixed example instrumented test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tim Krüger --- .../java/com/nextcloud/talk/ExampleInstrumentedTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/androidTest/java/com/nextcloud/talk/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/nextcloud/talk/ExampleInstrumentedTest.java index ff73dcd48..a55790b95 100644 --- a/app/src/androidTest/java/com/nextcloud/talk/ExampleInstrumentedTest.java +++ b/app/src/androidTest/java/com/nextcloud/talk/ExampleInstrumentedTest.java @@ -28,7 +28,8 @@ import org.junit.runner.RunWith; import androidx.test.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; -import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** * Instrumented test, which will execute on an Android device. @@ -42,6 +43,7 @@ public class ExampleInstrumentedTest { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); - assertEquals("com.nextcloud.talk", appContext.getPackageName()); + assertNotNull(appContext.getPackageName()); + assertTrue("The package name must start with 'com.nextcloud.talk2'", appContext.getPackageName().startsWith("com.nextcloud.talk2")); } }