Skip to content

Commit 8ad1263

Browse files
committed
check if client id in tests is blank
1 parent 7603b45 commit 8ad1263

File tree

1 file changed

+9
-2
lines changed
  • src/commonTest/kotlin/com.adamratzman/spotify

1 file changed

+9
-2
lines changed

src/commonTest/kotlin/com.adamratzman/spotify/Common.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ val _clientSecret = getEnvironmentVariable("SPOTIFY_CLIENT_SECRET")
66
val _redirectUri = getEnvironmentVariable("SPOTIFY_REDIRECT_URI")
77
val _tokenString = getEnvironmentVariable("SPOTIFY_TOKEN_STRING")
88

9-
val api = when {
9+
val api = {
10+
println(_redirectUri)
11+
println(_clientId)
12+
println(_redirectUri.isNullOrBlank())
13+
println(_clientId.isNullOrBlank())
14+
15+
}.let { when {
1016
_redirectUri?.isNotBlank() != true -> {
1117
spotifyAppApi {
1218
credentials {
@@ -15,7 +21,7 @@ val api = when {
1521
}
1622
}.build()
1723
}
18-
_clientId != null -> {
24+
_clientId?.isNotBlank() == true -> {
1925
spotifyClientApi {
2026
credentials {
2127
clientId = _clientId
@@ -29,6 +35,7 @@ val api = when {
2935
}
3036
else -> null
3137
}
38+
}
3239

3340
expect fun getEnvironmentVariable(name: String): String?
3441

0 commit comments

Comments
 (0)