Skip to content

Commit

Permalink
Disabling tests that needs env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
RichtXO committed Aug 29, 2024
1 parent 7b0eda8 commit 3db2cb9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/java/com/richtxo/util/spotify/SpotifyFetchTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.richtxo.util.spotify;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;

import static org.junit.jupiter.api.Assertions.*;

Expand All @@ -9,6 +10,8 @@ class SpotifyFetchTest {
private final SpotifyFetch fetch = new SpotifyFetch();

@Test
@DisabledIfEnvironmentVariable(named = "SPOTIFY_CLIENT_ID", matches = "", disabledReason = "Needs Spotify Client ID")
@DisabledIfEnvironmentVariable(named = "SPOTIFY_SECRET", matches = "", disabledReason = "Needs Spotify Secret")
void fetchSong() {
final SpotifySong valid =
fetch.fetchSong("https://open.spotify.com/track/4cOdK2wGLETKBW3PvgPWqT?si=8347518e3fd249f5");
Expand All @@ -21,6 +24,8 @@ void fetchSong() {
}

@Test
@DisabledIfEnvironmentVariable(named = "SPOTIFY_CLIENT_ID", matches = "", disabledReason = "Needs Spotify Client ID")
@DisabledIfEnvironmentVariable(named = "SPOTIFY_SECRET", matches = "", disabledReason = "Needs Spotify Secret")
void fetchPlaylist() {
final SpotifyPlaylist valid =
fetch.fetchPlaylist("https://open.spotify.com/playlist/51mPlHVdm7RAqdMACrOaXO?si=9ffd4363a75f4c41");
Expand All @@ -33,6 +38,8 @@ void fetchPlaylist() {
}

@Test
@DisabledIfEnvironmentVariable(named = "SPOTIFY_CLIENT_ID", matches = "", disabledReason = "Needs Spotify Client ID")
@DisabledIfEnvironmentVariable(named = "SPOTIFY_SECRET", matches = "", disabledReason = "Needs Spotify Secret")
void fetchAlbum() {
final SpotifyPlaylist valid =
fetch.fetchAlbum("https://open.spotify.com/album/5Z9iiGl2FcIfa3BMiv6OIw?si=QdYDFg5nSDmoi5grrwHH7g");
Expand Down

0 comments on commit 3db2cb9

Please sign in to comment.