MediaService { public Single<MediaContainer> playQueue(HttpUrl url, String trackKey, String trackParentKey, String libraryId) { return api.post(url.newBuilder() .addPathSegments("playQueues") .query("repeat=0&shuffle=0&type=audio&continuous=0") .addQueryParameter("key", trackKey) .addQueryParameter("uri", "library: .addQueryParameter(TOKEN, url.queryParameter(TOKEN)) .build()); } MediaService(Api api); Observable<MediaContainer> sections(HttpUrl url); Observable<MediaContainer> albums(HttpUrl url, String artistKey); Observable<MediaContainer> tracks(HttpUrl url, String albumKey); Observable<MediaContainer> popularTracks(HttpUrl url, String libKey, String artistKey); Observable<MediaContainer> browse(HttpUrl url, String libKey, String mediaKey,
                                           int offset); Observable<MediaContainer> recentArtists(HttpUrl url, String libKey); Observable<MediaContainer> firstCharacter(HttpUrl url, String libKey, String mediaKey); Completable timeline(HttpUrl url, long queueItemId, String trackKey, String trackRatingKey,
                              String state, long duration, long time); Single<MediaContainer> playQueue(HttpUrl url, String trackKey, String trackParentKey,
                                          String libraryId);  }
@Test public void playQueue() { media.playQueue(URL, "trackKey", "trackParentKey", "libraryId"); assertThat(api.actual, is("https: "&continuous=0&key=trackKey&uri=library%3A%2F%2FlibraryId%2Fitem%2FtrackParentKey" + "&X-Plex-Token=token")); }