Replace single-argument 'Arrays.asList()' with 'Collections.singletonList()'
This commit is contained in:
parent
f8d1f32e9b
commit
84b196746b
@ -11,6 +11,8 @@ import de.danoeh.antennapod.core.gpoddernet.GpodnetServiceException;
|
|||||||
import de.danoeh.antennapod.core.gpoddernet.model.GpodnetDevice;
|
import de.danoeh.antennapod.core.gpoddernet.model.GpodnetDevice;
|
||||||
import de.danoeh.antennapod.core.gpoddernet.model.GpodnetTag;
|
import de.danoeh.antennapod.core.gpoddernet.model.GpodnetTag;
|
||||||
|
|
||||||
|
import static java.util.Collections.singletonList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for GpodnetService
|
* Test class for GpodnetService
|
||||||
*/
|
*/
|
||||||
@ -55,7 +57,7 @@ public class GPodnetServiceTest extends AndroidTestCase {
|
|||||||
authenticate();
|
authenticate();
|
||||||
String[] URLS = {"http://bitsundso.de/feed", "http://gamesundso.de/feed", "http://cre.fm/feed/mp3/", "http://freakshow.fm/feed/m4a/"};
|
String[] URLS = {"http://bitsundso.de/feed", "http://gamesundso.de/feed", "http://cre.fm/feed/mp3/", "http://freakshow.fm/feed/m4a/"};
|
||||||
List<String> subscriptions = Arrays.asList(URLS[0], URLS[1]);
|
List<String> subscriptions = Arrays.asList(URLS[0], URLS[1]);
|
||||||
List<String> removed = Arrays.asList(URLS[0]);
|
List<String> removed = singletonList(URLS[0]);
|
||||||
List<String> added = Arrays.asList(URLS[2], URLS[3]);
|
List<String> added = Arrays.asList(URLS[2], URLS[3]);
|
||||||
service.uploadSubscriptions(USER, "radio", subscriptions);
|
service.uploadSubscriptions(USER, "radio", subscriptions);
|
||||||
service.uploadChanges(USER, "radio", added, removed);
|
service.uploadChanges(USER, "radio", added, removed);
|
||||||
|
@ -18,6 +18,8 @@ import de.danoeh.antennapod.core.storage.DBReader;
|
|||||||
import de.danoeh.antennapod.core.storage.DBTasks;
|
import de.danoeh.antennapod.core.storage.DBTasks;
|
||||||
import de.danoeh.antennapod.core.storage.PodDBAdapter;
|
import de.danoeh.antennapod.core.storage.PodDBAdapter;
|
||||||
|
|
||||||
|
import static java.util.Collections.singletonList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for DBTasks
|
* Test class for DBTasks
|
||||||
*/
|
*/
|
||||||
@ -125,7 +127,7 @@ public class DBTasksTest extends InstrumentationTestCase {
|
|||||||
public void testUpdateFeedMediaUrlResetState() {
|
public void testUpdateFeedMediaUrlResetState() {
|
||||||
final Feed feed = new Feed("url", null, "title");
|
final Feed feed = new Feed("url", null, "title");
|
||||||
FeedItem item = new FeedItem(0, "item", "id", "link", new Date(), FeedItem.PLAYED, feed);
|
FeedItem item = new FeedItem(0, "item", "id", "link", new Date(), FeedItem.PLAYED, feed);
|
||||||
feed.setItems(Arrays.asList(item));
|
feed.setItems(singletonList(item));
|
||||||
|
|
||||||
PodDBAdapter adapter = PodDBAdapter.getInstance();
|
PodDBAdapter adapter = PodDBAdapter.getInstance();
|
||||||
adapter.open();
|
adapter.open();
|
||||||
@ -138,7 +140,7 @@ public class DBTasksTest extends InstrumentationTestCase {
|
|||||||
|
|
||||||
FeedMedia media = new FeedMedia(item, "url", 1024, "mime/type");
|
FeedMedia media = new FeedMedia(item, "url", 1024, "mime/type");
|
||||||
item.setMedia(media);
|
item.setMedia(media);
|
||||||
feed.setItems(Arrays.asList(item));
|
feed.setItems(singletonList(item));
|
||||||
|
|
||||||
final Feed newFeed = DBTasks.updateFeed(context, feed)[0];
|
final Feed newFeed = DBTasks.updateFeed(context, feed)[0];
|
||||||
assertTrue(feed != newFeed);
|
assertTrue(feed != newFeed);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user