|
| 1 | +package getRequests; |
| 2 | + |
| 3 | +import Client.SpotifyClient; |
| 4 | +import Client.SpotifyLogin; |
| 5 | +import org.junit.jupiter.api.Test; |
| 6 | + |
| 7 | +import java.io.IOException; |
| 8 | + |
| 9 | +import static org.junit.jupiter.api.Assertions.assertNotNull; |
| 10 | + |
| 11 | +public class TracksTest { |
| 12 | + |
| 13 | + static SpotifyClient client; |
| 14 | + |
| 15 | + static { |
| 16 | + try { |
| 17 | + client = new SpotifyClient("d56c8c3f79a1459bba2c286cfa7aa15b", "9dcd475a773d467990dd75eede0af55f"); |
| 18 | + |
| 19 | + SpotifyLogin login = client.getLogin(); |
| 20 | + login.setEmailOrUsername("exampleEmail"); |
| 21 | + login.setPassword("examplePasword"); |
| 22 | + login.setRedirectUri("exampleRedirectURI"); |
| 23 | + login.addScope("user-modify-playback-state"); |
| 24 | + client.requestAuthCodeFlowCode(client); |
| 25 | + client.generateAccessTokenAndRefreshToken(client); |
| 26 | + |
| 27 | + |
| 28 | + } catch (IOException | InterruptedException e) { |
| 29 | + e.printStackTrace(); |
| 30 | + } |
| 31 | + } |
| 32 | + |
| 33 | + @Test |
| 34 | + void testGetSeveralTracks() throws IOException{ |
| 35 | + |
| 36 | + assertNotNull(client.getMultipleTracks(client)); |
| 37 | + |
| 38 | + } |
| 39 | + |
| 40 | + @Test |
| 41 | + void testGetSpecificTrack() throws IOException{ |
| 42 | + |
| 43 | + assertNotNull(client.getTrack(client)); |
| 44 | + |
| 45 | + } |
| 46 | + |
| 47 | + @Test |
| 48 | + void testGetAudioFeaturesOfMultipleTracks() throws IOException{ |
| 49 | + |
| 50 | + assertNotNull(client.getAudioFeaturesForSeveralTracks(client)); |
| 51 | + |
| 52 | + } |
| 53 | + |
| 54 | + @Test |
| 55 | + void testGetAudioFeaturesOfTrack() throws IOException{ |
| 56 | + |
| 57 | + assertNotNull(client.getTrackAudioFeature(client)); |
| 58 | + |
| 59 | + } |
| 60 | + |
| 61 | + @Test |
| 62 | + void testGetAudioAnalysisOfTrack() throws IOException{ |
| 63 | + |
| 64 | + assertNotNull(client.getTrackAudioAnalysis(client)); |
| 65 | + |
| 66 | + } |
| 67 | + |
| 68 | +} |
0 commit comments