@@ -47,10 +47,11 @@ class BrowseApiTest : AbstractTest<GenericSpotifyApi>() {
47
47
return runBlockingTest {
48
48
super .build<GenericSpotifyApi >()
49
49
if (! testPrereq()) return @runBlockingTest else api!!
50
- assertNotNull(api!! .browse.getCategory(" pop" ))
51
- assertNotNull(api!! .browse.getCategory(" pop" , Market .FR ))
52
- assertNotNull(api!! .browse.getCategory(" pop" , Market .FR , locale = Locale .en_US))
53
- assertNotNull(api!! .browse.getCategory(" pop" , Market .FR , locale = Locale .sr_ME))
50
+ val firstCategoryId = api!! .browse.getCategoryList(limit = 1 , market = Market .FR ).first()!! .id
51
+ assertNotNull(api!! .browse.getCategory(firstCategoryId))
52
+ assertNotNull(api!! .browse.getCategory(firstCategoryId, Market .FR ))
53
+ assertNotNull(api!! .browse.getCategory(firstCategoryId, Market .FR , locale = Locale .en_US))
54
+ assertNotNull(api!! .browse.getCategory(firstCategoryId, Market .FR , locale = Locale .sr_ME))
54
55
assertFailsWith<SpotifyException .BadRequestException > { api!! .browse.getCategory(" no u" , Market .US ) }
55
56
}
56
57
}
@@ -66,7 +67,7 @@ class BrowseApiTest : AbstractTest<GenericSpotifyApi>() {
66
67
limit = 4
67
68
)
68
69
}
69
- assertTrue(api!! .browse.getPlaylistsForCategory(" pop " , 10 , 0 , Market .FR ).items.isNotEmpty())
70
+ assertTrue(api!! .browse.getPlaylistsForCategory(api !! .browse.getCategoryList(limit = 1 ).first() !! .id , 10 , 0 , Market .FR ).items.isNotEmpty())
70
71
}
71
72
}
72
73
0 commit comments