Skip to content

Commit 01bbf62

Browse files
authored
fix(Country): add missing ISO 3166-1 alpha-2 country codes (#205)
1 parent 449ecfe commit 01bbf62

4 files changed

Lines changed: 574 additions & 7 deletions

File tree

src/integrationTest/java/io/github/yvasyliev/dz4j/TrackIT.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import io.github.yvasyliev.dz4j.model.Track;
77
import org.junit.jupiter.api.BeforeEach;
88
import org.junit.jupiter.api.Test;
9+
import org.junit.jupiter.params.ParameterizedTest;
10+
import org.junit.jupiter.params.provider.CsvSource;
911

1012
import java.io.IOException;
1113

@@ -26,10 +28,13 @@ void setUp(WireMockRuntimeInfo wmRuntimeInfo) {
2628
.build();
2729
}
2830

29-
@Test
30-
void shouldReturnTrack() throws IOException {
31-
var trackId = 541999L;
32-
var body = read("/response/track/get-track.json");
31+
@ParameterizedTest
32+
@CsvSource(textBlock = """
33+
541999, /response/track/get-track-maneater.json
34+
3135556, /response/track/get-track-harder-better-faster-stronger.json
35+
""")
36+
void shouldReturnTrack(long trackId, String file) throws IOException {
37+
var body = read(file);
3338
var expected = MAPPER.readValue(body, Track.class);
3439

3540
stubFor(get(urlPathTemplate("/track/{trackId}"))
Lines changed: 280 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,280 @@
1+
{
2+
"id": 3135556,
3+
"readable": true,
4+
"title": "Harder, Better, Faster, Stronger",
5+
"title_short": "Harder, Better, Faster, Stronger",
6+
"title_version": "",
7+
"isrc": "GBDUW0000059",
8+
"link": "https://www.deezer.com/track/3135556",
9+
"share": "https://www.deezer.com/track/3135556?utm_source=deezer&utm_content=track-3135556&utm_term=0_1785685053&utm_medium=web",
10+
"duration": 226,
11+
"track_position": 4,
12+
"disk_number": 1,
13+
"rank": 814839,
14+
"release_date": "2001-03-12",
15+
"explicit_lyrics": false,
16+
"explicit_content_lyrics": 0,
17+
"explicit_content_cover": 0,
18+
"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",
19+
"bpm": 0,
20+
"gain": -12.4,
21+
"available_countries": [
22+
"AE",
23+
"AF",
24+
"AG",
25+
"AI",
26+
"AL",
27+
"AM",
28+
"AO",
29+
"AQ",
30+
"AR",
31+
"AS",
32+
"AT",
33+
"AU",
34+
"AZ",
35+
"BA",
36+
"BB",
37+
"BD",
38+
"BE",
39+
"BF",
40+
"BG",
41+
"BH",
42+
"BI",
43+
"BJ",
44+
"BN",
45+
"BO",
46+
"BQ",
47+
"BR",
48+
"BT",
49+
"BV",
50+
"BW",
51+
"BY",
52+
"CA",
53+
"CC",
54+
"CD",
55+
"CF",
56+
"CG",
57+
"CH",
58+
"CI",
59+
"CK",
60+
"CL",
61+
"CM",
62+
"CN",
63+
"CO",
64+
"CR",
65+
"CV",
66+
"CW",
67+
"CX",
68+
"CY",
69+
"CZ",
70+
"DE",
71+
"DJ",
72+
"DK",
73+
"DM",
74+
"DO",
75+
"DZ",
76+
"EC",
77+
"EE",
78+
"EG",
79+
"EH",
80+
"ER",
81+
"ES",
82+
"ET",
83+
"FI",
84+
"FJ",
85+
"FK",
86+
"FM",
87+
"FR",
88+
"GA",
89+
"GB",
90+
"GD",
91+
"GE",
92+
"GH",
93+
"GM",
94+
"GN",
95+
"GQ",
96+
"GR",
97+
"GS",
98+
"GT",
99+
"GU",
100+
"GW",
101+
"HK",
102+
"HM",
103+
"HN",
104+
"HR",
105+
"HU",
106+
"ID",
107+
"IE",
108+
"IL",
109+
"IN",
110+
"IO",
111+
"IQ",
112+
"IS",
113+
"IT",
114+
"JM",
115+
"JO",
116+
"JP",
117+
"KE",
118+
"KG",
119+
"KH",
120+
"KI",
121+
"KM",
122+
"KN",
123+
"KR",
124+
"KW",
125+
"KY",
126+
"KZ",
127+
"LA",
128+
"LB",
129+
"LC",
130+
"LK",
131+
"LR",
132+
"LS",
133+
"LT",
134+
"LU",
135+
"LV",
136+
"LY",
137+
"MA",
138+
"MD",
139+
"ME",
140+
"MG",
141+
"MH",
142+
"MK",
143+
"ML",
144+
"MM",
145+
"MN",
146+
"MP",
147+
"MR",
148+
"MS",
149+
"MT",
150+
"MU",
151+
"MV",
152+
"MW",
153+
"MX",
154+
"MY",
155+
"MZ",
156+
"NA",
157+
"NE",
158+
"NF",
159+
"NG",
160+
"NI",
161+
"NL",
162+
"NO",
163+
"NP",
164+
"NR",
165+
"NU",
166+
"NZ",
167+
"OM",
168+
"PA",
169+
"PE",
170+
"PG",
171+
"PH",
172+
"PK",
173+
"PL",
174+
"PN",
175+
"PS",
176+
"PT",
177+
"PW",
178+
"PY",
179+
"QA",
180+
"RO",
181+
"RS",
182+
"RU",
183+
"RW",
184+
"SA",
185+
"SB",
186+
"SC",
187+
"SD",
188+
"SE",
189+
"SG",
190+
"SI",
191+
"SJ",
192+
"SK",
193+
"SL",
194+
"SN",
195+
"SO",
196+
"SS",
197+
"ST",
198+
"SV",
199+
"SX",
200+
"SZ",
201+
"TC",
202+
"TD",
203+
"TG",
204+
"TH",
205+
"TJ",
206+
"TK",
207+
"TL",
208+
"TM",
209+
"TN",
210+
"TO",
211+
"TR",
212+
"TV",
213+
"TW",
214+
"TZ",
215+
"UA",
216+
"UG",
217+
"US",
218+
"UY",
219+
"UZ",
220+
"VC",
221+
"VE",
222+
"VG",
223+
"VI",
224+
"VN",
225+
"VU",
226+
"WS",
227+
"YE",
228+
"ZA",
229+
"ZM",
230+
"ZW"
231+
],
232+
"contributors": [
233+
{
234+
"id": 27,
235+
"name": "Daft Punk",
236+
"link": "https://www.deezer.com/artist/27",
237+
"share": "https://www.deezer.com/artist/27?utm_source=deezer&utm_content=artist-27&utm_term=0_1785685053&utm_medium=web",
238+
"picture": "https://api.deezer.com/artist/27/image",
239+
"picture_small": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/56x56-000000-80-0-0.jpg",
240+
"picture_medium": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/250x250-000000-80-0-0.jpg",
241+
"picture_big": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/500x500-000000-80-0-0.jpg",
242+
"picture_xl": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/1000x1000-000000-80-0-0.jpg",
243+
"radio": true,
244+
"tracklist": "https://api.deezer.com/artist/27/top?limit=50",
245+
"type": "artist",
246+
"role": "Main"
247+
}
248+
],
249+
"md5_image": "5718f7c81c27e0b2417e2a4c45224f8a",
250+
"track_token": "AAAAAWpvZD1qcH19cmD8bAe9ezdb4nAzYJsbJcSbH9xoe27IrYeizB1UntD3bfkQ3cMtPxC1ihqEnqju_wQZgjQHRQ6kp8WG3Uw6bGOupIv5ehl2yPFerx-kl1HvNunSoUeTonxkeIy4xvRFfRKfiGKpT9uFN1_xA8qPShPWF_QdeAu7CaeQgITsr3o-1ASo-DSCO5LCcSaKF7rU_ZPph9K8JnvKiYoi43wgQFvfmR_DCg9uFZFosEAALiPUBnO_Bl28FiVJAudEe9MjpwjROt9hJ1Y08pOdQpm54G90olxLgsJJzkppIJv0KzcNfpiSfT76QEeL8_msUO1Tf2xE2C9jJ1uL_FHofqMZ7zzGP5yirsg9J6h3zuPNs34mQACZqRUc5EXg",
251+
"artist": {
252+
"id": 27,
253+
"name": "Daft Punk",
254+
"link": "https://www.deezer.com/artist/27",
255+
"share": "https://www.deezer.com/artist/27?utm_source=deezer&utm_content=artist-27&utm_term=0_1785685053&utm_medium=web",
256+
"picture": "https://api.deezer.com/artist/27/image",
257+
"picture_small": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/56x56-000000-80-0-0.jpg",
258+
"picture_medium": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/250x250-000000-80-0-0.jpg",
259+
"picture_big": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/500x500-000000-80-0-0.jpg",
260+
"picture_xl": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/1000x1000-000000-80-0-0.jpg",
261+
"radio": true,
262+
"tracklist": "https://api.deezer.com/artist/27/top?limit=50",
263+
"type": "artist"
264+
},
265+
"album": {
266+
"id": 302127,
267+
"title": "Discovery",
268+
"link": "https://www.deezer.com/album/302127",
269+
"cover": "https://api.deezer.com/album/302127/image",
270+
"cover_small": "https://cdn-images.dzcdn.net/images/cover/5718f7c81c27e0b2417e2a4c45224f8a/56x56-000000-80-0-0.jpg",
271+
"cover_medium": "https://cdn-images.dzcdn.net/images/cover/5718f7c81c27e0b2417e2a4c45224f8a/250x250-000000-80-0-0.jpg",
272+
"cover_big": "https://cdn-images.dzcdn.net/images/cover/5718f7c81c27e0b2417e2a4c45224f8a/500x500-000000-80-0-0.jpg",
273+
"cover_xl": "https://cdn-images.dzcdn.net/images/cover/5718f7c81c27e0b2417e2a4c45224f8a/1000x1000-000000-80-0-0.jpg",
274+
"md5_image": "5718f7c81c27e0b2417e2a4c45224f8a",
275+
"release_date": "2001-03-07",
276+
"tracklist": "https://api.deezer.com/album/302127/tracks",
277+
"type": "album"
278+
},
279+
"type": "track"
280+
}

src/integrationTest/resources/response/track/get-track.json renamed to src/integrationTest/resources/response/track/get-track-maneater.json

File renamed without changes.

0 commit comments

Comments
 (0)