@@ -5,12 +5,12 @@ import com.google.common.truth.Subject
55import com.google.common.truth.Truth.assertAbout
66import com.google.common.truth.Truth.assertThat
77import kotlin.test.assertEquals
8+ import kotlin.test.assertFailsWith
89import org.gradle.api.Project
910import org.gradle.api.file.Directory
1011import org.gradle.api.file.RegularFile
1112import org.gradle.api.provider.Provider
1213import org.gradle.api.tasks.TaskProvider
13- import org.gradle.internal.impldep.org.junit.Assert.assertThrows
1414import org.gradle.testfixtures.ProjectBuilder
1515import org.junit.Rule
1616import org.junit.Test
@@ -184,8 +184,7 @@ class SentryUploadAppArtifactTaskTest {
184184 it.bundle.set(nonExistentBundle)
185185 }
186186
187- val exception =
188- assertThrows(IllegalStateException ::class .java) { task.get().computeCommandLineArgs() }
187+ val exception = assertFailsWith<IllegalStateException > { task.get().computeCommandLineArgs() }
189188
190189 assertThat(exception.message).startsWith(" Bundle file does not exist:" )
191190 }
@@ -200,8 +199,7 @@ class SentryUploadAppArtifactTaskTest {
200199 it.apk.set(nonExistentApkDir)
201200 }
202201
203- val exception =
204- assertThrows(IllegalStateException ::class .java) { task.get().computeCommandLineArgs() }
202+ val exception = assertFailsWith<IllegalStateException > { task.get().computeCommandLineArgs() }
205203
206204 assertThat(exception.message).startsWith(" APK directory does not exist:" )
207205 }
@@ -218,8 +216,7 @@ class SentryUploadAppArtifactTaskTest {
218216 it.apk.set(emptyApkDir)
219217 }
220218
221- val exception =
222- assertThrows(IllegalStateException ::class .java) { task.get().computeCommandLineArgs() }
219+ val exception = assertFailsWith<IllegalStateException > { task.get().computeCommandLineArgs() }
223220
224221 assertThat(exception.message).startsWith(" No APK file exists in directory:" )
225222 }
@@ -232,8 +229,7 @@ class SentryUploadAppArtifactTaskTest {
232229 it.cliExecutable.set(" sentry-cli" )
233230 }
234231
235- val exception =
236- assertThrows(IllegalStateException ::class .java) { task.get().computeCommandLineArgs() }
232+ val exception = assertFailsWith<IllegalStateException > { task.get().computeCommandLineArgs() }
237233
238234 assertThat(exception.message).isEqualTo(" No bundle or apk found" )
239235 }
0 commit comments