Skip to content

Commit 4470738

Browse files
committed
fix utility tests
1 parent 12cc484 commit 4470738

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

build.gradle.kts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ tasks.getByName<KotlinJsCompile>("compileKotlinJs") {
110110
}
111111
}
112112
tasks.named<Test>("jvmTest") {
113-
systemProperty("clientId", System.getProperty("clientId"))
114-
systemProperty("clientSecret", System.getProperty("clientSecret"))
115-
systemProperty("spotifyRedirectUri", System.getProperty("spotifyRedirectUri"))
116-
systemProperty("spotifyTokenString", System.getProperty("spotifyTokenString"))
117-
118113
useJUnitPlatform()
119114
}
120115

src/commonTest/kotlin/com.adamratzman/spotify/utilities/UtilityTests.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import com.adamratzman.spotify.api
66
import com.adamratzman.spotify.getEnvironmentVariable
77
import com.adamratzman.spotify.spotifyAppApi
88
import com.adamratzman.spotify.spotifyClientApi
9-
import kotlin.test.assertFailsWith
109
import kotlinx.coroutines.GlobalScope
1110
import org.spekframework.spek2.Spek
1211
import org.spekframework.spek2.style.specification.describe
12+
import kotlin.test.assertFailsWith
1313

1414
class UtilityTests : Spek({
1515
describe("Utility tests") {
@@ -22,7 +22,7 @@ class UtilityTests : Spek({
2222
assertFailsWith<IllegalArgumentException> {
2323
spotifyClientApi {
2424
credentials {
25-
clientId = getEnvironmentVariable("clientId")
25+
clientId = getEnvironmentVariable("SPOTIFY_CLIENT_ID")
2626
}
2727
}.build()
2828
}
@@ -34,8 +34,8 @@ class UtilityTests : Spek({
3434
assertFailsWith<IllegalArgumentException> {
3535
spotifyClientApi {
3636
credentials {
37-
clientId = getEnvironmentVariable("clientId")
38-
clientSecret = getEnvironmentVariable("clientSecret")
37+
clientId = getEnvironmentVariable("SPOTIFY_CLIENT_ID")
38+
clientSecret = getEnvironmentVariable("SPOTIFY_CLIENT_SECRET")
3939
}
4040
}.build()
4141
}
@@ -45,8 +45,8 @@ class UtilityTests : Spek({
4545
it("App API valid parameters") {
4646
val api = spotifyAppApi {
4747
credentials {
48-
clientId = getEnvironmentVariable("clientId")
49-
clientSecret = getEnvironmentVariable("clientSecret")
48+
clientId = getEnvironmentVariable("SPOTIFY_CLIENT_ID")
49+
clientSecret = getEnvironmentVariable("SPOTIFY_CLIENT_SECRET")
5050
}
5151
}
5252
api.build()
@@ -56,8 +56,8 @@ class UtilityTests : Spek({
5656
it("Refresh on invalid token") {
5757
val api = spotifyAppApi {
5858
credentials {
59-
clientId = getEnvironmentVariable("clientId")
60-
clientSecret = getEnvironmentVariable("clientSecret")
59+
clientId = getEnvironmentVariable("SPOTIFY_CLIENT_ID")
60+
clientSecret = getEnvironmentVariable("SPOTIFY_CLIENT_SECRET")
6161
}
6262
}.build()
6363
}

0 commit comments

Comments
 (0)