@@ -47,10 +47,11 @@ class BrowseApiTest : AbstractTest<GenericSpotifyApi>() {
4747 return runBlockingTest {
4848 super .build<GenericSpotifyApi >()
4949 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))
5455 assertFailsWith<SpotifyException .BadRequestException > { api!! .browse.getCategory(" no u" , Market .US ) }
5556 }
5657 }
@@ -66,7 +67,7 @@ class BrowseApiTest : AbstractTest<GenericSpotifyApi>() {
6667 limit = 4
6768 )
6869 }
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())
7071 }
7172 }
7273
0 commit comments