@Test public void shouldReturnSongsOfChannel() throws Exception { songsGateway.querySongsByChannelId(ReportType.NEXT_QUEUE, "1", 10, ChannelConstantIds.PRIVATE_CHANNEL,BitRate.HIGH, new Callback()); apiGateway.simulateTextResponse(200, TestResponses.ROCK_CHANNELS_SONGS_JSON, null); assertNotNull(Douban.songs); assertThat(Douban.songs.size(), equalTo(2)); assertThat(Douban.songs.get(0).aid, equalTo("25779410")); }
public void querySongsByChannelId(ReportType songType, String currentSongId, int playTime, int channelId, BitRate bitRate, Callback callback) { if(channelId== ChannelConstantIds.PRIVATE_CHANNEL ||channelId== ChannelConstantIds.FAV){ this.isAuthRequire=true; } apiGateway.makeRequest(new SongsRequest(channelId, bitRate, songType,currentSongId, playTime), new SongApiResponseCallback(callback, this, douban)); }
SongsGateway extends BaseApiGateway { public void querySongsByChannelId(ReportType songType, String currentSongId, int playTime, int channelId, BitRate bitRate, Callback callback) { if(channelId== ChannelConstantIds.PRIVATE_CHANNEL ||channelId== ChannelConstantIds.FAV){ this.isAuthRequire=true; } apiGateway.makeRequest(new SongsRequest(channelId, bitRate, songType,currentSongId, playTime), new SongApiResponseCallback(callback, this, douban)); } }
SongsGateway extends BaseApiGateway { public void querySongsByChannelId(ReportType songType, String currentSongId, int playTime, int channelId, BitRate bitRate, Callback callback) { if(channelId== ChannelConstantIds.PRIVATE_CHANNEL ||channelId== ChannelConstantIds.FAV){ this.isAuthRequire=true; } apiGateway.makeRequest(new SongsRequest(channelId, bitRate, songType,currentSongId, playTime), new SongApiResponseCallback(callback, this, douban)); } SongsGateway(Douban douban, ApiGateway apiGateway); }
SongsGateway extends BaseApiGateway { public void querySongsByChannelId(ReportType songType, String currentSongId, int playTime, int channelId, BitRate bitRate, Callback callback) { if(channelId== ChannelConstantIds.PRIVATE_CHANNEL ||channelId== ChannelConstantIds.FAV){ this.isAuthRequire=true; } apiGateway.makeRequest(new SongsRequest(channelId, bitRate, songType,currentSongId, playTime), new SongApiResponseCallback(callback, this, douban)); } SongsGateway(Douban douban, ApiGateway apiGateway); void querySongsByChannelId(ReportType songType, String currentSongId, int playTime, int channelId, BitRate bitRate, Callback callback); }
SongsGateway extends BaseApiGateway { public void querySongsByChannelId(ReportType songType, String currentSongId, int playTime, int channelId, BitRate bitRate, Callback callback) { if(channelId== ChannelConstantIds.PRIVATE_CHANNEL ||channelId== ChannelConstantIds.FAV){ this.isAuthRequire=true; } apiGateway.makeRequest(new SongsRequest(channelId, bitRate, songType,currentSongId, playTime), new SongApiResponseCallback(callback, this, douban)); } SongsGateway(Douban douban, ApiGateway apiGateway); void querySongsByChannelId(ReportType songType, String currentSongId, int playTime, int channelId, BitRate bitRate, Callback callback); static final Gson GSON; }