Fixed example instrumented test

Signed-off-by: Tim Krüger <t@timkrueger.me>
This commit is contained in:
Tim Krüger 2021-12-07 11:32:01 +01:00
parent 707841ec29
commit 390fa154b5
No known key found for this signature in database
GPG Key ID: FECE3A7222C52A4E

View File

@ -28,7 +28,8 @@ import org.junit.runner.RunWith;
import androidx.test.InstrumentationRegistry; import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4; 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. * Instrumented test, which will execute on an Android device.
@ -42,6 +43,7 @@ public class ExampleInstrumentedTest {
// Context of the app under test. // Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext(); 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"));
} }
} }