From b231a56c9ab7ab49a2a0e38a661e585896041b88 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Thu, 3 Nov 2022 06:57:18 -0600 Subject: [PATCH] Fix tests --- app/build.gradle | 3 ++- .../java/com/wbrawner/simplemarkdown/MarkdownTests.kt | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f66cbd8..5b60628 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -137,11 +137,12 @@ android.productFlavors.each { flavor -> } jacoco { - toolVersion = '0.8.0' + toolVersion = '0.8.8' } tasks.withType(Test) { jacoco.includeNoLocationClasses = true + jacoco.excludes = ['jdk.internal.*'] } task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) { diff --git a/app/src/androidTest/java/com/wbrawner/simplemarkdown/MarkdownTests.kt b/app/src/androidTest/java/com/wbrawner/simplemarkdown/MarkdownTests.kt index 607149a..3b6bc9c 100644 --- a/app/src/androidTest/java/com/wbrawner/simplemarkdown/MarkdownTests.kt +++ b/app/src/androidTest/java/com/wbrawner/simplemarkdown/MarkdownTests.kt @@ -116,7 +116,7 @@ class MarkdownTests { val markdownText = "# UI Testing\n\nThe quick brown fox jumped over the lazy dog." onView(withId(R.id.markdown_edit)).perform(typeText(markdownText)) val activityResult = Instrumentation.ActivityResult(RESULT_OK, Intent().apply { - data = FileProvider.getUriForFile(getApplicationContext(), "com.wbrawner.simplemarkdown.fileprovider", file) + data = FileProvider.getUriForFile(getApplicationContext(), "${BuildConfig.APPLICATION_ID}.fileprovider", file) }) intending(hasAction(Intent.ACTION_CREATE_DOCUMENT)).respondWith(activityResult) openActionBarOverflowOrOptionsMenu(getApplicationContext()) @@ -146,7 +146,7 @@ class MarkdownTests { val markdownText = "# UI Testing\n\nThe quick brown fox jumped over the lazy dog." file.outputStream().writer().use { it.write(markdownText) } val activityResult = Instrumentation.ActivityResult(RESULT_OK, Intent().apply { - data = FileProvider.getUriForFile(getApplicationContext(), "com.wbrawner.simplemarkdown.fileprovider", file) + data = FileProvider.getUriForFile(getApplicationContext(), "${BuildConfig.APPLICATION_ID}.fileprovider", file) }) intending(hasAction(Intent.ACTION_OPEN_DOCUMENT)).respondWith(activityResult) openActionBarOverflowOrOptionsMenu(getApplicationContext())