Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/integrationTest/java/io/github/yvasyliev/dz4j/TrackIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import io.github.yvasyliev.dz4j.model.Track;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;

import java.io.IOException;

Expand All @@ -26,10 +28,13 @@ void setUp(WireMockRuntimeInfo wmRuntimeInfo) {
.build();
}

@Test
void shouldReturnTrack() throws IOException {
var trackId = 541999L;
var body = read("/response/track/get-track.json");
@ParameterizedTest
@CsvSource(textBlock = """
541999, /response/track/get-track-maneater.json
3135556, /response/track/get-track-harder-better-faster-stronger.json
""")
void shouldReturnTrack(long trackId, String file) throws IOException {
var body = read(file);
var expected = MAPPER.readValue(body, Track.class);

stubFor(get(urlPathTemplate("/track/{trackId}"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
{
"id": 3135556,
"readable": true,
"title": "Harder, Better, Faster, Stronger",
"title_short": "Harder, Better, Faster, Stronger",
"title_version": "",
"isrc": "GBDUW0000059",
"link": "https://www.deezer.com/track/3135556",
"share": "https://www.deezer.com/track/3135556?utm_source=deezer&utm_content=track-3135556&utm_term=0_1785685053&utm_medium=web",
"duration": 226,
"track_position": 4,
"disk_number": 1,
"rank": 814839,
"release_date": "2001-03-12",
"explicit_lyrics": false,
"explicit_content_lyrics": 0,
"explicit_content_cover": 0,
"preview": "https://cdnt-preview.dzcdn.net/api/1/1/6/a/2/0/6a2c0a5670afe821e08fc5154909534a.mp3?hdnea=exp=1785685953~acl=/api/1/1/6/a/2/0/6a2c0a5670afe821e08fc5154909534a.mp3*~data=user_id=0,application_id=42~hmac=fbfdc65e83193ebda61d03e71638effcdcbdfd5bbcd2e5b4a3ac40e8a9f67b19",
"bpm": 0,
"gain": -12.4,
"available_countries": [
"AE",
"AF",
"AG",
"AI",
"AL",
"AM",
"AO",
"AQ",
"AR",
"AS",
"AT",
"AU",
"AZ",
"BA",
"BB",
"BD",
"BE",
"BF",
"BG",
"BH",
"BI",
"BJ",
"BN",
"BO",
"BQ",
"BR",
"BT",
"BV",
"BW",
"BY",
"CA",
"CC",
"CD",
"CF",
"CG",
"CH",
"CI",
"CK",
"CL",
"CM",
"CN",
"CO",
"CR",
"CV",
"CW",
"CX",
"CY",
"CZ",
"DE",
"DJ",
"DK",
"DM",
"DO",
"DZ",
"EC",
"EE",
"EG",
"EH",
"ER",
"ES",
"ET",
"FI",
"FJ",
"FK",
"FM",
"FR",
"GA",
"GB",
"GD",
"GE",
"GH",
"GM",
"GN",
"GQ",
"GR",
"GS",
"GT",
"GU",
"GW",
"HK",
"HM",
"HN",
"HR",
"HU",
"ID",
"IE",
"IL",
"IN",
"IO",
"IQ",
"IS",
"IT",
"JM",
"JO",
"JP",
"KE",
"KG",
"KH",
"KI",
"KM",
"KN",
"KR",
"KW",
"KY",
"KZ",
"LA",
"LB",
"LC",
"LK",
"LR",
"LS",
"LT",
"LU",
"LV",
"LY",
"MA",
"MD",
"ME",
"MG",
"MH",
"MK",
"ML",
"MM",
"MN",
"MP",
"MR",
"MS",
"MT",
"MU",
"MV",
"MW",
"MX",
"MY",
"MZ",
"NA",
"NE",
"NF",
"NG",
"NI",
"NL",
"NO",
"NP",
"NR",
"NU",
"NZ",
"OM",
"PA",
"PE",
"PG",
"PH",
"PK",
"PL",
"PN",
"PS",
"PT",
"PW",
"PY",
"QA",
"RO",
"RS",
"RU",
"RW",
"SA",
"SB",
"SC",
"SD",
"SE",
"SG",
"SI",
"SJ",
"SK",
"SL",
"SN",
"SO",
"SS",
"ST",
"SV",
"SX",
"SZ",
"TC",
"TD",
"TG",
"TH",
"TJ",
"TK",
"TL",
"TM",
"TN",
"TO",
"TR",
"TV",
"TW",
"TZ",
"UA",
"UG",
"US",
"UY",
"UZ",
"VC",
"VE",
"VG",
"VI",
"VN",
"VU",
"WS",
"YE",
"ZA",
"ZM",
"ZW"
],
"contributors": [
{
"id": 27,
"name": "Daft Punk",
"link": "https://www.deezer.com/artist/27",
"share": "https://www.deezer.com/artist/27?utm_source=deezer&utm_content=artist-27&utm_term=0_1785685053&utm_medium=web",
"picture": "https://api.deezer.com/artist/27/image",
"picture_small": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/56x56-000000-80-0-0.jpg",
"picture_medium": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/250x250-000000-80-0-0.jpg",
"picture_big": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/500x500-000000-80-0-0.jpg",
"picture_xl": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/1000x1000-000000-80-0-0.jpg",
"radio": true,
"tracklist": "https://api.deezer.com/artist/27/top?limit=50",
"type": "artist",
"role": "Main"
}
],
"md5_image": "5718f7c81c27e0b2417e2a4c45224f8a",
"track_token": "AAAAAWpvZD1qcH19cmD8bAe9ezdb4nAzYJsbJcSbH9xoe27IrYeizB1UntD3bfkQ3cMtPxC1ihqEnqju_wQZgjQHRQ6kp8WG3Uw6bGOupIv5ehl2yPFerx-kl1HvNunSoUeTonxkeIy4xvRFfRKfiGKpT9uFN1_xA8qPShPWF_QdeAu7CaeQgITsr3o-1ASo-DSCO5LCcSaKF7rU_ZPph9K8JnvKiYoi43wgQFvfmR_DCg9uFZFosEAALiPUBnO_Bl28FiVJAudEe9MjpwjROt9hJ1Y08pOdQpm54G90olxLgsJJzkppIJv0KzcNfpiSfT76QEeL8_msUO1Tf2xE2C9jJ1uL_FHofqMZ7zzGP5yirsg9J6h3zuPNs34mQACZqRUc5EXg",
"artist": {
"id": 27,
"name": "Daft Punk",
"link": "https://www.deezer.com/artist/27",
"share": "https://www.deezer.com/artist/27?utm_source=deezer&utm_content=artist-27&utm_term=0_1785685053&utm_medium=web",
"picture": "https://api.deezer.com/artist/27/image",
"picture_small": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/56x56-000000-80-0-0.jpg",
"picture_medium": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/250x250-000000-80-0-0.jpg",
"picture_big": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/500x500-000000-80-0-0.jpg",
"picture_xl": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/1000x1000-000000-80-0-0.jpg",
"radio": true,
"tracklist": "https://api.deezer.com/artist/27/top?limit=50",
"type": "artist"
},
"album": {
"id": 302127,
"title": "Discovery",
"link": "https://www.deezer.com/album/302127",
"cover": "https://api.deezer.com/album/302127/image",
"cover_small": "https://cdn-images.dzcdn.net/images/cover/5718f7c81c27e0b2417e2a4c45224f8a/56x56-000000-80-0-0.jpg",
"cover_medium": "https://cdn-images.dzcdn.net/images/cover/5718f7c81c27e0b2417e2a4c45224f8a/250x250-000000-80-0-0.jpg",
"cover_big": "https://cdn-images.dzcdn.net/images/cover/5718f7c81c27e0b2417e2a4c45224f8a/500x500-000000-80-0-0.jpg",
"cover_xl": "https://cdn-images.dzcdn.net/images/cover/5718f7c81c27e0b2417e2a4c45224f8a/1000x1000-000000-80-0-0.jpg",
"md5_image": "5718f7c81c27e0b2417e2a4c45224f8a",
"release_date": "2001-03-07",
"tracklist": "https://api.deezer.com/album/302127/tracks",
"type": "album"
},
"type": "track"
}
Loading