Skip to content

Commit 0d60099

Browse files
authored
Update TESTING.md
1 parent 7c14bcc commit 0d60099

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

TESTING.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
We use [Spek](https://github.com/spekframework/spek) to run unit tests. You must add Maven Central to the gradle repositories
44
in order to pull Spek.
55

6-
To run **only** public endpoint tests, run
6+
To run any test, you must have two environment variables, `SPOTIFY_CLIENT_ID` and `SPOTIFY_CLIENT_SECRET` set to a Spotify application in your current shell.
77

8-
`gradle test -PclientId=YOUR_CLIENT_ID -PclientSecret=YOUR_CLIENT_SECRET`
8+
To run **only** public endpoint and utility tests, run `gradle check`
99

10-
To run **all** tests, you need a valid Spotify application, redirect uri, and token string. use:
10+
To run **all** tests, you need a valid Spotify redirect uri, and token (string). These are `SPOTIFY_REDIRECT_URI` and `SPOTIFY_TOKEN_STRING` respectively.
1111

12-
`gradle test -PclientId=YOUR_CLIENT_ID -PclientSecret=YOUR_CLIENT_SECRET -PspotifyRedirectUri=SPOTIFY_REDIRECT_URI -PspotifyTokenString=SPOTIFY_TOKEN`
12+
Then: `gradle check`
1313

1414
Some tests may fail if you do not allow access to all required scopes. To mitigate this, you can individually grant
1515
each scope or use the following code snippet to print out the Spotify token string (given a generated authorization code)
1616

1717
**How to generate an authorization URL**
1818
```kotlin
19-
import com.adamratzman.spotify.main.SpotifyScope
20-
import com.adamratzman.spotify.main.spotifyApi
19+
import com.adamratzman.spotify.SpotifyScope
20+
import com.adamratzman.spotify.spotifyClientApi
2121

22-
spotifyApi {
22+
spotifyClientApi {
2323
credentials {
2424
clientId = "YOUR_CLIENT_ID"
2525
clientSecret = "YOUR_CLIENT_SECRET"
@@ -31,16 +31,16 @@ spotifyApi {
3131

3232
**How to get a Spotify token**
3333
```kotlin
34-
import com.adamratzman.spotify.main.spotifyApi
34+
import com.adamratzman.spotify.spotifyClientApi
3535

36-
spotifyApi {
37-
credentials {
36+
spotifyClientApi {
37+
credentials {
3838
clientId = "YOUR_CLIENT_ID"
3939
clientSecret = "YOUR_CLIENT_SECRET"
4040
redirectUri = "YOUR_REDIRECT_URI"
4141
}
42-
clientAuthentication {
42+
authorization {
4343
authorizationCode = "SPOTIFY_AUTHORIZATION_CODE"
4444
}
45-
}.buildClient().token.access_token.let { println(it) }
45+
}.build().token.accessToken.let { println(it) }
4646
```

0 commit comments

Comments
 (0)