@@ -0,0 +1,2613 @@
+package se.michaelthelin.spotify.methods;%0A%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0Aimport se.michaelthelin.spotify.Api;%0Aimport se.michaelthelin.spotify.JsonUtilTest;%0Aimport se.michaelthelin.spotify.SpotifyProtos.Track;%0Aimport se.michaelthelin.spotify.SpotifyProtos.Album;%0Aimport se.michaelthelin.spotify.SpotifyProtos.Artist;%0A%0Aimport java.util.List;%0A%0Aimport static junit.framework.Assert.assertEquals;%0Aimport static org.mockito.Mockito.spy;%0Aimport static org.mockito.Mockito.when;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class SearchRequestTest %7B%0A%0A  @Test%0A  public void shouldGetArtistsResult() throws Exception %7B%0A    Api api = Api.DEFAULT_API;%0A    SearchRequest request = api.search().query(%22David Bowie%22).type(%22artist%22).build();%0A%0A    // Mock response%0A    String responseFixture = JsonUtilTest.readTestData(%22artists.json%22);%0A    SearchRequest spy = spy(request);%0A    when(spy.getJson()).thenReturn(responseFixture);%0A%0A    List%3CArtist%3E artists = spy.getArtists();%0A    assertEquals(2, artists.size());%0A%0A    Artist firstArtist = artists.get(0);%0A    Artist secondArtist = artists.get(1);%0A%0A    assertEquals(%220oSGxfWSnnOXhD2fKuz2Gy%22, firstArtist.getId());%0A    assertEquals(%223dBVyJ7JuOMt4GE9607Qin%22, secondArtist.getId());%0A  %7D%0A%0A  @Test%0A  public void shouldGetTracksResult() throws Exception %7B%0A    Api api = Api.DEFAULT_API;%0A    SearchRequest request = api.search().query(%22Mr. Brightside%22).type(%22track%22).build();%0A%0A    // Mock response%0A    String responseFixture = JsonUtilTest.readTestData(%22tracks.json%22);%0A    SearchRequest spy = spy(request);%0A    when(spy.getJson()).thenReturn(responseFixture);%0A%0A    List%3CTrack%3E tracks = spy.getTracks();%0A%0A    assertEquals(2, tracks.size());%0A%0A    Track firstTrack = tracks.get(0);%0A    assertEquals(%220eGsygTp906u18L0Oimnem%22, firstTrack.getId());%0A%0A    Track secondTrack = tracks.get(1);%0A    assertEquals(%221lDWb6b6ieDQ2xT7ewTC3G%22, secondTrack.getId());%0A  %7D%0A%0A  @Test%0A  public void shouldGetAlbumsResult() throws Exception %7B%0A    Api api = Api.DEFAULT_API;%0A    SearchRequest request = api.search().query(%22The Best Of Keane%22).type(%22album%22).build();%0A%0A    // Mock response%0A    String responseFixture = JsonUtilTest.readTestData(%22albums.json%22);%0A    SearchRequest spy = spy(request);%0A    when(spy.getJson()).thenReturn(responseFixture);%0A%0A    List%3CAlbum%3E albums = spy.getAlbums();%0A%0A    assertEquals(2, albums.size());%0A%0A    Album firstAlbum = albums.get(0);%0A    assertEquals(%2241MnTivkwTO3UUJ8DrqEJJ%22, firstAlbum.getId());%0A%0A    Album secondAlbum = albums.get(1);%0A    assertEquals(%226JWc4iAiJ9FjyK0B59ABb4%22, secondAlbum.getId());%0A  %7D%0A%0A%7D%0A

Add test for Search request