diff options
39 files changed, 67 insertions, 450 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/handler/FeedHandlerTest.java b/app/src/androidTest/java/de/test/antennapod/handler/FeedHandlerTest.java index 4f6bf0c1f..6d842aff5 100644 --- a/app/src/androidTest/java/de/test/antennapod/handler/FeedHandlerTest.java +++ b/app/src/androidTest/java/de/test/antennapod/handler/FeedHandlerTest.java @@ -139,19 +139,19 @@ public class FeedHandlerTest { @Test public void testRSS2Basic() throws IOException, UnsupportedFeedtypeException, SAXException, ParserConfigurationException { - Feed f1 = createTestFeed(10, false, true, true); + Feed f1 = createTestFeed(10, true); Feed f2 = runFeedTest(f1, new RSS2Generator(), "UTF-8", RSS2Generator.FEATURE_WRITE_GUID); feedValid(f1, f2, Feed.TYPE_RSS2); } @Test public void testAtomBasic() throws IOException, UnsupportedFeedtypeException, SAXException, ParserConfigurationException { - Feed f1 = createTestFeed(10, false, true, true); + Feed f1 = createTestFeed(10, true); Feed f2 = runFeedTest(f1, new AtomGenerator(), "UTF-8", 0); feedValid(f1, f2, Feed.TYPE_ATOM1); } - private Feed createTestFeed(int numItems, boolean withImage, boolean withFeedMedia, boolean withChapters) { + private Feed createTestFeed(int numItems, boolean withFeedMedia) { Feed feed = new Feed(0, null, "title", "http://example.com", "This is the description", "http://example.com/payment", "Daniel", "en", null, "http://example.com/feed", "http://example.com/picture", file.getAbsolutePath(), "http://example.com/feed", true); diff --git a/app/src/androidTest/java/de/test/antennapod/service/download/DownloadServiceTest.java b/app/src/androidTest/java/de/test/antennapod/service/download/DownloadServiceTest.java index b7f062223..c5fec66b7 100644 --- a/app/src/androidTest/java/de/test/antennapod/service/download/DownloadServiceTest.java +++ b/app/src/androidTest/java/de/test/antennapod/service/download/DownloadServiceTest.java @@ -45,13 +45,10 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; /** - * @see HttpDownloaderTest for the test of actual download (and saving the file) + * @see HttpDownloaderTest for the test of actual download (and saving the file). */ @RunWith(AndroidJUnit4.class) public class DownloadServiceTest { - - private CountDownLatch latch = null; - private Feed testFeed = null; private FeedMedia testMedia11 = null; private DownloaderFactory origFactory = null; @@ -61,7 +58,7 @@ public class DownloadServiceTest { EspressoTestUtils.clearDatabase(); EspressoTestUtils.clearPreferences(); origFactory = DownloadService.getDownloaderFactory(); - testFeed = setUpTestFeeds(); + Feed testFeed = setUpTestFeeds(); testMedia11 = testFeed.getItemAtIndex(0).getMedia(); } diff --git a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java index d4af79645..a00a9965f 100644 --- a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java +++ b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java @@ -124,7 +124,6 @@ public class PlaybackServiceMediaPlayerTest { } private Playable writeTestPlayable(String downloadUrl, String fileUrl) { - final Context c = getInstrumentation().getTargetContext(); Feed f = new Feed(0, null, "f", "l", "d", null, null, null, null, "i", null, null, "l", false); FeedPreferences prefs = new FeedPreferences(f.getId(), false, FeedPreferences.AutoDeleteAction.NO, VolumeAdaptionSetting.OFF, null, null); f.setPreferences(prefs); diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java b/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java index 666cd845e..f4a66ee61 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java @@ -1,20 +1,16 @@ package de.test.antennapod.storage; -import android.content.Context; - import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Random; import androidx.test.InstrumentationRegistry; -import androidx.test.filters.LargeTest; import androidx.test.filters.SmallTest; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.storage.DBReader; -import de.danoeh.antennapod.core.storage.FeedItemStatistics; import de.danoeh.antennapod.core.storage.PodDBAdapter; import de.danoeh.antennapod.core.util.LongList; import org.junit.After; @@ -103,7 +99,6 @@ public class DBReaderTest { @Test public void testLoadFeedDataOfFeedItemlist() { - final Context context = InstrumentationRegistry.getTargetContext(); final int numFeeds = 10; final int numItems = 1; List<Feed> feeds = saveFeedlist(numFeeds, numItems, false); @@ -314,23 +309,10 @@ public class DBReaderTest { } @Test - public void testGetFeedStatisticsCheckOrder() { - final int NUM_FEEDS = 10; - final int NUM_ITEMS = 10; - List<Feed> feeds = DBTestUtils.saveFeedlist(NUM_FEEDS, NUM_ITEMS, false); - List<FeedItemStatistics> statistics = DBReader.getFeedStatisticsList(); - assertNotNull(statistics); - assertEquals(feeds.size(), statistics.size()); - for (int i = 0; i < NUM_FEEDS; i++) { - assertEquals("Wrong entry at index " + i, feeds.get(i).getId(), statistics.get(i).getFeedID()); - } - } - - @Test public void testGetNavDrawerDataQueueEmptyNoUnreadItems() { final int NUM_FEEDS = 10; final int NUM_ITEMS = 10; - List<Feed> feeds = DBTestUtils.saveFeedlist(NUM_FEEDS, NUM_ITEMS, true); + DBTestUtils.saveFeedlist(NUM_FEEDS, NUM_ITEMS, true); DBReader.NavDrawerData navDrawerData = DBReader.getNavDrawerData(); assertEquals(NUM_FEEDS, navDrawerData.feeds.size()); assertEquals(0, navDrawerData.numNewItems); diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java b/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java index 7decc49d4..4910882e3 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java @@ -422,7 +422,6 @@ public class DBWriterTest { } private FeedMedia playbackHistorySetup(Date playbackCompletionDate) { - final Context context = getInstrumentation().getTargetContext(); Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<>()); FeedItem item = new FeedItem(0, "title", "id", "link", new Date(), FeedItem.PLAYED, feed); @@ -558,7 +557,6 @@ public class DBWriterTest { @Test public void testAddQueueItemMultipleItems() throws InterruptedException, ExecutionException, TimeoutException { - final Context context = getInstrumentation().getTargetContext(); final int NUM_ITEMS = 10; Feed feed = queueTestSetupMultipleItems(NUM_ITEMS); @@ -583,7 +581,7 @@ public class DBWriterTest { public void testClearQueue() throws InterruptedException, ExecutionException, TimeoutException { final int NUM_ITEMS = 10; - Feed feed = queueTestSetupMultipleItems(NUM_ITEMS); + queueTestSetupMultipleItems(NUM_ITEMS); DBWriter.clearQueue().get(TIMEOUT, TimeUnit.SECONDS); PodDBAdapter adapter = PodDBAdapter.getInstance(); adapter.open(); diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java index 5b5cd3058..e71c36ef2 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java @@ -618,7 +618,7 @@ public class OnlineFeedViewActivity extends AppCompatActivity { private final String feedUrl; FeedViewAuthenticationDialog(Context context, int titleRes, String feedUrl) { - super(context, titleRes, true, false, null, null); + super(context, titleRes, true, null, null); this.feedUrl = feedUrl; } @@ -629,7 +629,7 @@ public class OnlineFeedViewActivity extends AppCompatActivity { } @Override - protected void onConfirmed(String username, String password, boolean saveUsernamePassword) { + protected void onConfirmed(String username, String password) { startFeedDownload(feedUrl, username, password); } } diff --git a/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java index c79c611ce..224b8d182 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java @@ -190,8 +190,6 @@ public class GpodnetAuthenticationActivity extends AppCompatActivity { final AtomicReference<List<GpodnetDevice>> devices = new AtomicReference<>(); new AsyncTask<GpodnetService, Void, List<GpodnetDevice>>() { - private volatile Exception exception; - @Override protected void onPreExecute() { super.onPreExecute(); @@ -226,7 +224,6 @@ public class GpodnetAuthenticationActivity extends AppCompatActivity { return params[0].getDevices(username); } catch (GpodnetServiceException e) { e.printStackTrace(); - exception = e; return null; } } diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java index 5f019d1db..2b498cd47 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java @@ -38,13 +38,6 @@ public abstract class StatisticsListAdapter extends RecyclerView.Adapter<Recycle return statisticsData.size() + 1; } - public StatisticsItem getItem(int position) { - if (position == 0) { - return null; - } - return statisticsData.get(position - 1); - } - @Override public int getItemViewType(int position) { return position == 0 ? TYPE_HEADER : TYPE_FEED; diff --git a/app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java b/app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java index f50b4143b..99a3f7ac0 100644 --- a/app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java +++ b/app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java @@ -45,11 +45,6 @@ public class DownloadServiceCallbacksImpl implements DownloadServiceCallbacks { } @Override - public void onFeedParsed(Context context, Feed feed) { - // do nothing - } - - @Override public boolean shouldCreateReport() { return true; } diff --git a/app/src/main/java/de/danoeh/antennapod/config/PlaybackServiceCallbacksImpl.java b/app/src/main/java/de/danoeh/antennapod/config/PlaybackServiceCallbacksImpl.java index c3f5d898c..a462c4034 100644 --- a/app/src/main/java/de/danoeh/antennapod/config/PlaybackServiceCallbacksImpl.java +++ b/app/src/main/java/de/danoeh/antennapod/config/PlaybackServiceCallbacksImpl.java @@ -33,8 +33,4 @@ public class PlaybackServiceCallbacksImpl implements PlaybackServiceCallbacks { return true; } - @Override - public int getNotificationIconResource(Context context) { - return R.drawable.ic_antenna; - } } diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/AuthenticationDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/AuthenticationDialog.java index 073f7b550..fb2f92742 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/AuthenticationDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/AuthenticationDialog.java @@ -3,7 +3,6 @@ package de.danoeh.antennapod.dialog; import android.app.AlertDialog; import android.content.Context; import android.view.View; -import android.widget.CheckBox; import android.widget.EditText; import de.danoeh.antennapod.R; @@ -13,8 +12,7 @@ import de.danoeh.antennapod.R; public abstract class AuthenticationDialog extends AlertDialog.Builder { public AuthenticationDialog(Context context, int titleRes, boolean enableUsernameField, - boolean showSaveCredentialsCheckbox, String usernameInitialValue, - String passwordInitialValue) { + String usernameInitialValue, String passwordInitialValue) { super(context); setTitle(titleRes); View rootView = View.inflate(context, R.layout.authentication_dialog, null); @@ -22,14 +20,8 @@ public abstract class AuthenticationDialog extends AlertDialog.Builder { final EditText etxtUsername = rootView.findViewById(R.id.etxtUsername); final EditText etxtPassword = rootView.findViewById(R.id.etxtPassword); - final CheckBox saveUsernamePassword = rootView.findViewById(R.id.chkSaveUsernamePassword); etxtUsername.setEnabled(enableUsernameField); - if (showSaveCredentialsCheckbox) { - saveUsernamePassword.setVisibility(View.VISIBLE); - } else { - saveUsernamePassword.setVisibility(View.GONE); - } if (usernameInitialValue != null) { etxtUsername.setText(usernameInitialValue); } @@ -39,13 +31,12 @@ public abstract class AuthenticationDialog extends AlertDialog.Builder { setOnCancelListener(dialog -> onCancelled()); setNegativeButton(R.string.cancel_label, null); setPositiveButton(R.string.confirm_label, (dialog, which) - -> onConfirmed(etxtUsername.getText().toString(), etxtPassword.getText().toString(), - showSaveCredentialsCheckbox && saveUsernamePassword.isChecked())); + -> onConfirmed(etxtUsername.getText().toString(), etxtPassword.getText().toString())); } protected void onCancelled() { } - protected abstract void onConfirmed(String username, String password, boolean saveUsernamePassword); + protected abstract void onConfirmed(String username, String password); } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java index 216c8cc57..05f38000c 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java @@ -25,7 +25,6 @@ import java.util.Set; * supports swiping to mark as read. */ public class AllEpisodesFragment extends EpisodesListFragment { - public static final String TAG = "AllEpisodesFragment"; private static final String PREF_NAME = "PrefAllEpisodesFragment"; private static final String PREF_FILTER = "filter"; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java index 2cddc10cb..23b8b7f19 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java @@ -200,10 +200,10 @@ public class FeedSettingsFragment extends Fragment { private void setupAuthentificationPreference() { findPreference("authentication").setOnPreferenceClickListener(preference -> { new AuthenticationDialog(getContext(), - R.string.authentication_label, true, false, + R.string.authentication_label, true, feedPreferences.getUsername(), feedPreferences.getPassword()) { @Override - protected void onConfirmed(String username, String password, boolean saveUsernamePassword) { + protected void onConfirmed(String username, String password) { feedPreferences.setUsername(username); feedPreferences.setPassword(password); feed.savePreferences(); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemPagerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemPagerFragment.java index f251de5ec..6f04ff1e5 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemPagerFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemPagerFragment.java @@ -41,16 +41,6 @@ public class ItemPagerFragment extends Fragment { /** * Creates a new instance of an ItemPagerFragment. * - * @param feeditem The ID of the FeedItem that should be displayed. - * @return The ItemFragment instance - */ - public static ItemPagerFragment newInstance(long feeditem) { - return newInstance(new long[] { feeditem }, 0); - } - - /** - * Creates a new instance of an ItemPagerFragment. - * * @param feeditems The IDs of the FeedItems that belong to the same list * @param feedItemPos The position of the FeedItem that is currently shown * @return The ItemFragment instance diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java index e34f1ea1c..3ebdd80d8 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java @@ -1,6 +1,5 @@ package de.danoeh.antennapod.fragment.gpodnet; -import android.content.res.Resources; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -28,7 +27,7 @@ public class GpodnetMainFragment extends Fragment { ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar); ViewPager viewPager = root.findViewById(R.id.viewpager); - GpodnetPagerAdapter pagerAdapter = new GpodnetPagerAdapter(getChildFragmentManager(), getResources()); + GpodnetPagerAdapter pagerAdapter = new GpodnetPagerAdapter(getChildFragmentManager()); viewPager.setAdapter(pagerAdapter); // Give the TabLayout the ViewPager @@ -39,18 +38,13 @@ public class GpodnetMainFragment extends Fragment { } public class GpodnetPagerAdapter extends FragmentPagerAdapter { - - private static final int NUM_PAGES = 2; private static final int POS_TOPLIST = 0; private static final int POS_TAGS = 1; private static final int POS_SUGGESTIONS = 2; - final Resources resources; - - public GpodnetPagerAdapter(FragmentManager fm, Resources resources) { + public GpodnetPagerAdapter(FragmentManager fm) { super(fm); - this.resources = resources; } @Override diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/GpodderPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/GpodderPreferencesFragment.java index 1e51380ca..271b31fad 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/GpodderPreferencesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/GpodderPreferencesFragment.java @@ -63,11 +63,11 @@ public class GpodderPreferencesFragment extends PreferenceFragmentCompat { findPreference(PREF_GPODNET_SETLOGIN_INFORMATION) .setOnPreferenceClickListener(preference -> { AuthenticationDialog dialog = new AuthenticationDialog(activity, - R.string.pref_gpodnet_setlogin_information_title, false, false, GpodnetPreferences.getUsername(), + R.string.pref_gpodnet_setlogin_information_title, false, GpodnetPreferences.getUsername(), null) { @Override - protected void onConfirmed(String username, String password, boolean saveUsernamePassword) { + protected void onConfirmed(String username, String password) { GpodnetPreferences.setPassword(password); } }; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/UserInterfacePreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/UserInterfacePreferencesFragment.java index 2e7c5c6af..0ea8d5b93 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/UserInterfacePreferencesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/UserInterfacePreferencesFragment.java @@ -8,7 +8,6 @@ import com.google.android.material.snackbar.Snackbar; import androidx.appcompat.app.AlertDialog; import androidx.preference.PreferenceFragmentCompat; import android.widget.ListView; -import android.widget.Toast; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.activity.PreferenceActivity; @@ -19,7 +18,6 @@ import org.apache.commons.lang3.ArrayUtils; import java.util.List; public class UserInterfacePreferencesFragment extends PreferenceFragmentCompat { - private static final String PREF_EXPANDED_NOTIFICATION = "prefExpandNotify"; @Override public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { diff --git a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java index 4d3e1ff72..edd594385 100644 --- a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java +++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java @@ -41,8 +41,7 @@ public class FeedItemMenuHandler { * @param selectedItem The FeedItem for which the menu is supposed to be prepared * @return Returns true if selectedItem is not null. */ - public static boolean onPrepareMenu(Menu menu, - FeedItem selectedItem) { + public static boolean onPrepareMenu(Menu menu, FeedItem selectedItem) { if (menu == null || selectedItem == null) { return false; } @@ -146,15 +145,13 @@ public class FeedItemMenuHandler { } /** - * The same method as onPrepareMenu(MenuInterface, FeedItem, boolean, QueueAccess), but lets the + * The same method as {@link #onPrepareMenu(Menu, FeedItem)}, but lets the * caller also specify a list of menu items that should not be shown. * * @param excludeIds Menu item that should be excluded * @return true if selectedItem is not null. */ - public static boolean onPrepareMenu(Menu menu, - FeedItem selectedItem, - int... excludeIds) { + public static boolean onPrepareMenu(Menu menu, FeedItem selectedItem, int... excludeIds) { if (menu == null || selectedItem == null ) { return false; } diff --git a/app/src/main/java/de/danoeh/antennapod/spa/SPAUtil.java b/app/src/main/java/de/danoeh/antennapod/spa/SPAUtil.java index 5fa6588d9..1f28b5c49 100644 --- a/app/src/main/java/de/danoeh/antennapod/spa/SPAUtil.java +++ b/app/src/main/java/de/danoeh/antennapod/spa/SPAUtil.java @@ -6,8 +6,6 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.util.Log; -import org.apache.commons.lang3.Validate; - import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.receiver.SPAReceiver; @@ -22,7 +20,6 @@ public class SPAUtil { private SPAUtil() { } - /** * Sends an ACTION_SP_APPS_QUERY_FEEDS intent to all AntennaPod Single Purpose apps. * The receiving single purpose apps will then send their feeds back to AntennaPod via an @@ -53,17 +50,4 @@ public class SPAUtil { return false; } } - - /** - * Resets all preferences created by this class. Should only be used for debug purposes. - */ - public static void resetSPAPreferences(Context c) { - if (BuildConfig.DEBUG) { - Validate.notNull(c); - SharedPreferences.Editor editor = PreferenceManager - .getDefaultSharedPreferences(c.getApplicationContext()).edit(); - editor.putBoolean(PREF_HAS_QUERIED_SP_APPS, false); - editor.apply(); - } - } } diff --git a/app/src/main/java/de/danoeh/antennapod/view/OnSwipeGesture.java b/app/src/main/java/de/danoeh/antennapod/view/OnSwipeGesture.java deleted file mode 100644 index eb72a7135..000000000 --- a/app/src/main/java/de/danoeh/antennapod/view/OnSwipeGesture.java +++ /dev/null @@ -1,9 +0,0 @@ -package de.danoeh.antennapod.view; - -public interface OnSwipeGesture { - - boolean onSwipeLeftToRight(); - - boolean onSwipeRightToLeft(); - -} diff --git a/app/src/main/java/de/danoeh/antennapod/view/viewholder/DownloadItemViewHolder.java b/app/src/main/java/de/danoeh/antennapod/view/viewholder/DownloadItemViewHolder.java index d48db196f..274dd4ea8 100644 --- a/app/src/main/java/de/danoeh/antennapod/view/viewholder/DownloadItemViewHolder.java +++ b/app/src/main/java/de/danoeh/antennapod/view/viewholder/DownloadItemViewHolder.java @@ -11,12 +11,10 @@ import android.widget.TextView; import androidx.recyclerview.widget.RecyclerView; import com.joanzapata.iconify.widget.IconTextView; import de.danoeh.antennapod.R; -import de.danoeh.antennapod.view.CircularProgressBar; public class DownloadItemViewHolder extends RecyclerView.ViewHolder { public final View secondaryActionButton; public final ImageView secondaryActionIcon; - public final CircularProgressBar secondaryActionProgress; public final IconTextView icon; public final TextView title; public final TextView type; @@ -29,7 +27,6 @@ public class DownloadItemViewHolder extends RecyclerView.ViewHolder { type = itemView.findViewById(R.id.txtvType); icon = itemView.findViewById(R.id.txtvIcon); reason = itemView.findViewById(R.id.txtvReason); - secondaryActionProgress = itemView.findViewById(R.id.secondaryActionProgress); secondaryActionButton = itemView.findViewById(R.id.secondaryActionButton); secondaryActionIcon = itemView.findViewById(R.id.secondaryActionIcon); title = itemView.findViewById(R.id.txtvTitle); diff --git a/app/src/main/res/layout/authentication_dialog.xml b/app/src/main/res/layout/authentication_dialog.xml index 1661eaea1..9c6f3e2bb 100644 --- a/app/src/main/res/layout/authentication_dialog.xml +++ b/app/src/main/res/layout/authentication_dialog.xml @@ -27,10 +27,4 @@ android:focusableInTouchMode="true" android:cursorVisible="true"/> - <CheckBox - android:id="@+id/chkSaveUsernamePassword" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="16dp" - android:text="@string/save_username_password_label"/> </LinearLayout>
\ No newline at end of file diff --git a/core/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java b/core/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java index e56445489..dbaece14a 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java @@ -3,11 +3,10 @@ package de.danoeh.antennapod.core; import android.app.PendingIntent; import android.content.Context; -import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.service.download.DownloadRequest; /** - * Callbacks for the DownloadService of the core module + * Callbacks for the DownloadService of the core module. */ public interface DownloadServiceCallbacks { @@ -43,13 +42,6 @@ public interface DownloadServiceCallbacks { PendingIntent getReportNotificationContentIntent(Context context); /** - * Called by the FeedSyncThread after a feed has been downloaded and parsed. - * - * @param feed The non-null feed that has been parsed. - */ - void onFeedParsed(Context context, Feed feed); - - /** * Returns true if the DownloadService should create a report that shows the number of failed * downloads when the service shuts down. * */ diff --git a/core/src/main/java/de/danoeh/antennapod/core/PlaybackServiceCallbacks.java b/core/src/main/java/de/danoeh/antennapod/core/PlaybackServiceCallbacks.java index 13a32ab8a..194ee65ae 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/PlaybackServiceCallbacks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/PlaybackServiceCallbacks.java @@ -26,9 +26,4 @@ public interface PlaybackServiceCallbacks { * finishes. */ boolean useQueue(); - - /** - * Returns a drawable resource that is used for the notification of the playback service. - */ - int getNotificationIconResource(Context context); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/event/QueueEvent.java b/core/src/main/java/de/danoeh/antennapod/core/event/QueueEvent.java index 209dcba4d..f9a8c63b6 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/event/QueueEvent.java +++ b/core/src/main/java/de/danoeh/antennapod/core/event/QueueEvent.java @@ -59,18 +59,6 @@ public class QueueEvent { return new QueueEvent(Action.MOVED, item, null, newPosition); } - public boolean contains(long id) { - if(item != null) { - return item.getId() == id; - } - for(FeedItem item : items) { - if(item.getId() == id) { - return true; - } - } - return false; - } - @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java b/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java index b1598f111..0889e5182 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java @@ -225,14 +225,6 @@ public class Feed extends FeedFile implements ImageResource { } /** - * Returns the number of FeedItems. - * - */ - public int getNumOfItems() { - return items.size(); - } - - /** * Returns the item at the specified index. * */ diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java index 572f32e66..80b205c0f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java @@ -221,16 +221,6 @@ public class FeedMedia extends FeedFile implements Playable { ((PlaybackPreferences.getCurrentPlayerStatus() == PlaybackPreferences.PLAYER_STATUS_PLAYING)); } - /** - * Reads playback preferences to determine whether this FeedMedia object is - * currently being played and the current player status is paused. - */ - public boolean isCurrentlyPaused() { - return isPlaying() && - ((PlaybackPreferences.getCurrentPlayerStatus() == PlaybackPreferences.PLAYER_STATUS_PAUSED)); - } - - public boolean hasAlmostEnded() { int smartMarkAsPlayedSecs = UserPreferences.getSmartMarkAsPlayedSecs(); return this.position >= this.duration - smartMarkAsPlayedSecs * 1000; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/handler/FeedSyncTask.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/handler/FeedSyncTask.java index 718faaa0a..8be3d2980 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/handler/FeedSyncTask.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/handler/FeedSyncTask.java @@ -2,16 +2,13 @@ package de.danoeh.antennapod.core.service.download.handler; import android.content.Context; import android.util.Log; -import de.danoeh.antennapod.core.ClientConfig; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.service.download.DownloadRequest; import de.danoeh.antennapod.core.service.download.DownloadStatus; -import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.storage.DownloadRequestException; import de.danoeh.antennapod.core.storage.DownloadRequester; import de.danoeh.antennapod.core.syndication.handler.FeedHandlerResult; -import java.util.List; public class FeedSyncTask { private static final String TAG = "FeedParserTask"; @@ -46,8 +43,6 @@ public class FeedSyncTask { Log.e(TAG, "Error trying to load next page", e); } } - - ClientConfig.downloadServiceCallbacks.onFeedParsed(context, savedFeed); return true; } diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java index e818f3072..d31f5d688 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java @@ -160,12 +160,12 @@ public final class DBReader { } /** - * Loads the list of FeedItems for a certain Feed-object. This method should NOT be used if the FeedItems are not - * used. In order to get information ABOUT the list of FeedItems, consider using {@link #getFeedStatisticsList()} instead. + * Loads the list of FeedItems for a certain Feed-object. + * This method should NOT be used if the FeedItems are not used. * * @param feed The Feed whose items should be loaded * @return A list with the FeedItems of the Feed. The Feed-attribute of the FeedItems will already be set correctly. - * The method does NOT change the items-attribute of the feed. + * The method does NOT change the items-attribute of the feed. */ public static List<FeedItem> getFeedItemList(final Feed feed) { Log.d(TAG, "getFeedItemList() called with: " + "feed = [" + feed + "]"); @@ -273,8 +273,7 @@ public final class DBReader { * Loads the IDs of the FeedItems in the queue. This method should be preferred over * {@link #getQueue()} if the FeedItems of the queue are not needed. * - * @return A list of IDs sorted by the same order as the queue. The caller can wrap the returned - * list in a {@link de.danoeh.antennapod.core.util.QueueAccess} object for easier access to the queue's properties. + * @return A list of IDs sorted by the same order as the queue. */ public static LongList getQueueIDList() { Log.d(TAG, "getQueueIDList() called"); @@ -307,8 +306,7 @@ public final class DBReader { * Loads a list of the FeedItems in the queue. If the FeedItems of the queue are not used directly, consider using * {@link #getQueueIDList()} instead. * - * @return A list of FeedItems sorted by the same order as the queue. The caller can wrap the returned - * list in a {@link de.danoeh.antennapod.core.util.QueueAccess} object for easier access to the queue's properties. + * @return A list of FeedItems sorted by the same order as the queue. */ @NonNull public static List<FeedItem> getQueue() { @@ -546,34 +544,6 @@ public final class DBReader { } /** - * Loads the FeedItemStatistics objects of all Feeds in the database. This method should be preferred over - * {@link #getFeedItemList(Feed)} if only metadata about - * the FeedItems is needed. - * - * @return A list of FeedItemStatistics objects sorted alphabetically by their Feed's title. - */ - public static List<FeedItemStatistics> getFeedStatisticsList() { - Log.d(TAG, "getFeedStatisticsList() called"); - PodDBAdapter adapter = PodDBAdapter.getInstance(); - adapter.open(); - Cursor cursor = null; - try { - cursor = adapter.getFeedStatisticsCursor(); - List<FeedItemStatistics> result = new ArrayList<>(cursor.getCount()); - while (cursor.moveToNext()) { - FeedItemStatistics fis = FeedItemStatistics.fromCursor(cursor); - result.add(fis); - } - return result; - } finally { - if (cursor != null) { - cursor.close(); - } - adapter.close(); - } - } - - /** * Loads a specific Feed from the database. * * @param feedId The ID of the Feed diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/FeedItemStatistics.java b/core/src/main/java/de/danoeh/antennapod/core/storage/FeedItemStatistics.java deleted file mode 100644 index d84279f6e..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/FeedItemStatistics.java +++ /dev/null @@ -1,81 +0,0 @@ -package de.danoeh.antennapod.core.storage; - -import android.database.Cursor; - -import java.util.Date; - -/** - * Contains information about a feed's items. - */ -public class FeedItemStatistics { - private final long feedID; - private final int numberOfItems; - private final int numberOfNewItems; - private final int numberOfInProgressItems; - private final Date lastUpdate; - private static final Date UNKNOWN_DATE = new Date(0); - - - /** - * Creates new FeedItemStatistics object. - * - * @param feedID ID of the feed. - * @param numberOfItems Number of items that this feed has. - * @param numberOfNewItems Number of unread items this feed has. - * @param numberOfInProgressItems Number of items that the user has started listening to. - * @param lastUpdate pubDate of the latest episode. A lastUpdate value of 0 will be interpreted as DATE_UNKOWN if - * numberOfItems is 0. - */ - private FeedItemStatistics(long feedID, int numberOfItems, int numberOfNewItems, int numberOfInProgressItems, Date lastUpdate) { - this.feedID = feedID; - this.numberOfItems = numberOfItems; - this.numberOfNewItems = numberOfNewItems; - this.numberOfInProgressItems = numberOfInProgressItems; - if (numberOfItems > 0) { - this.lastUpdate = (lastUpdate != null) ? (Date) lastUpdate.clone() : null; - } else { - this.lastUpdate = UNKNOWN_DATE; - } - } - - public static FeedItemStatistics fromCursor(Cursor cursor) { - return new FeedItemStatistics( - cursor.getLong(0), - cursor.getInt(1), - cursor.getInt(2), - cursor.getInt(4), - new Date(cursor.getLong(3))); - } - - public long getFeedID() { - return feedID; - } - - public int getNumberOfItems() { - return numberOfItems; - } - - public int getNumberOfNewItems() { - return numberOfNewItems; - } - - public int getNumberOfInProgressItems() { - return numberOfInProgressItems; - } - - /** - * Returns the pubDate of the latest item in the feed. Users of this method - * should check if this value is unkown or not by calling lastUpdateKnown() first. - */ - public Date getLastUpdate() { - return (lastUpdate != null) ? (Date) lastUpdate.clone() : null; - } - - /** - * Returns true if the lastUpdate value is known. The lastUpdate value is unkown if the - * feed has no items. - */ - public boolean lastUpdateKnown() { - return lastUpdate != UNKNOWN_DATE; - } -} diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java index 714b8d8a7..e85d5fae1 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java @@ -36,16 +36,7 @@ public class AtomText extends SyndElement { } } - public String getContent() { - return content; - } - public void setContent(String content) { this.content = content; } - - public String getType() { - return type; - } - } diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/util/SyndTypeUtils.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/util/SyndTypeUtils.java index 1d564ab0e..6c151d39b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/util/SyndTypeUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/util/SyndTypeUtils.java @@ -37,21 +37,6 @@ public class SyndTypeUtils { } } - - /** - * Should be used if mime-type of enclosure tag is not supported. This - * method will check if the mime-type of the file extension is supported. If - * the type is not supported, this method will return null. - */ - public static String getValidMimeTypeFromUrl(String url) { - String type = getMimeTypeFromUrl(url); - if (enclosureTypeValid(type)) { - return type; - } else { - return null; - } - } - /** * Should be used if mime-type of enclosure tag is not supported. This * method will return the mime-type of the file extension. diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/InvalidFeedException.java b/core/src/main/java/de/danoeh/antennapod/core/util/InvalidFeedException.java index a2795194d..ebde1e412 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/InvalidFeedException.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/InvalidFeedException.java @@ -8,16 +8,4 @@ public class InvalidFeedException extends Exception { public InvalidFeedException() { } - - public InvalidFeedException(String message) { - super(message); - } - - public InvalidFeedException(Throwable cause) { - super(cause); - } - - public InvalidFeedException(String message, Throwable cause) { - super(message, cause); - } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/QueueAccess.java b/core/src/main/java/de/danoeh/antennapod/core/util/QueueAccess.java deleted file mode 100644 index ec8b8a430..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/util/QueueAccess.java +++ /dev/null @@ -1,29 +0,0 @@ -package de.danoeh.antennapod.core.util; - -import java.util.Iterator; -import java.util.List; - -import de.danoeh.antennapod.core.feed.FeedItem; - -/** - * Provides methods for accessing the queue. It is possible to load only a part of the information about the queue that - * is stored in the database (e.g. sometimes the user just has to test if a specific item is contained in the List. - * QueueAccess provides an interface for accessing the queue without having to care about the type of the queue - * representation. - */ -public abstract class QueueAccess { - /** - * Returns true if the item is in the queue, false otherwise. - */ - public abstract boolean contains(long id); - - /** - * Removes the item from the queue. - * - * @return true if the queue was modified by this operation. - */ - public abstract boolean remove(long id); - - private QueueAccess() { - } -} diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java b/core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java deleted file mode 100644 index f9e2e9991..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java +++ /dev/null @@ -1,18 +0,0 @@ -package de.danoeh.antennapod.core.util.exception; - -import de.danoeh.antennapod.core.feed.FeedMedia; - -public class MediaFileNotFoundException extends Exception { - private static final long serialVersionUID = 1L; - - private final FeedMedia media; - - public MediaFileNotFoundException(String msg, FeedMedia media) { - super(msg); - this.media = media; - } - - public FeedMedia getMedia() { - return media; - } -} diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3ReaderException.java b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3ReaderException.java index 021268adb..7a68bb5ce 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3ReaderException.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3ReaderException.java @@ -3,18 +3,7 @@ package de.danoeh.antennapod.core.util.id3reader; public class ID3ReaderException extends Exception { private static final long serialVersionUID = 1L; - public ID3ReaderException() { - } - public ID3ReaderException(String message) { super(message); } - - public ID3ReaderException(Throwable message) { - super(message); - } - - public ID3ReaderException(String message, Throwable cause) { - super(message, cause); - } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java index a11406171..6c4dafa0d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java @@ -382,12 +382,6 @@ public class PlaybackController { public void onPlaybackEnd() {} - public void repeatHandleStatus() { - if (status != null && playbackService != null) { - handleStatus(); - } - } - /** * Is called whenever the PlaybackService changes its status. This method * should be used to update the GUI or start/cancel background threads. diff --git a/core/src/test/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculatorTest.java b/core/src/test/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculatorTest.java index 275b104ea..80777d036 100644 --- a/core/src/test/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculatorTest.java +++ b/core/src/test/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculatorTest.java @@ -120,10 +120,6 @@ public class ItemEnqueuePositionCalculatorTest { return ItemEnqueuePositionCalculatorTest.getCurrentlyPlaying(idCurrentlyPlaying); } - private static Playable externalMedia() { - return new ExternalMedia("http://example.com/episode.mp3", MediaType.AUDIO); - } - private static final long ID_CURRENTLY_PLAYING_NULL = -1L; private static final long ID_CURRENTLY_PLAYING_NOT_FEEDMEDIA = -9999L; diff --git a/core/src/test/java/de/danoeh/antennapod/core/util/FeedItemUtilTest.java b/core/src/test/java/de/danoeh/antennapod/core/util/FeedItemUtilTest.java index 0b64cb10f..2560ac6a0 100644 --- a/core/src/test/java/de/danoeh/antennapod/core/util/FeedItemUtilTest.java +++ b/core/src/test/java/de/danoeh/antennapod/core/util/FeedItemUtilTest.java @@ -13,61 +13,49 @@ import de.danoeh.antennapod.core.feed.FeedItem; import static org.junit.Assert.assertEquals; +@RunWith(Parameterized.class) public class FeedItemUtilTest { + private static final String FEED_LINK = "http://example.com"; + private static final String ITEM_LINK = "http://example.com/feedItem1"; + + private final String msg; + private final String feedLink; + private final String itemLink; + private final String expected; + + @Parameters + public static Collection<Object[]> data() { + return Arrays.asList(new Object[][] { + { "average", FEED_LINK, ITEM_LINK, ITEM_LINK }, + { "null item link - fallback to feed", FEED_LINK, null, FEED_LINK}, + { "empty item link - same as null", FEED_LINK, "", FEED_LINK}, + { "blank item link - same as null", FEED_LINK, " ", FEED_LINK}, + { "fallback, but feed link is null too", null, null, null }, + { "fallback - but empty feed link - same as null", "", null, null}, + { "fallback - but blank feed link - same as null", " ", null, null} + }); + } + public FeedItemUtilTest(String msg, String feedLink, String itemLink, String expected) { + this.msg = msg; + this.feedLink = feedLink; + this.itemLink = itemLink; + this.expected = expected; + } - @RunWith(Parameterized.class) - public static class LinkWithFallbackTest { - private static final String FEED_LINK = "http://example.com"; - private static final String ITEM_LINK = "http://example.com/feedItem1"; - - @Parameters - public static Collection<Object[]> data() { - return Arrays.asList(new Object[][] { - { "average", - FEED_LINK, ITEM_LINK, ITEM_LINK }, - { "null item link - fallback to feed", - FEED_LINK, null, FEED_LINK}, - { "empty item link - same as null", - FEED_LINK, "", FEED_LINK}, - { "blank item link - same as null", - FEED_LINK, " ", FEED_LINK}, - { "fallback, but feed link is null too", - null, null, null }, - { "fallback - but empty feed link - same as null", - "", null, null}, - { "fallback - but blank feed link - same as null", - " ", null, null} - }); - } - - private final String msg; - private final String feedLink; - private final String itemLink; - private final String expected; - - public LinkWithFallbackTest(String msg, String feedLink, String itemLink, String expected) { - this.msg = msg; - this.feedLink = feedLink; - this.itemLink = itemLink; - this.expected = expected; - } - - - @Test - public void testLinkWithFallback() { - String actual = FeedItemUtil.getLinkWithFallback(createFeedItem(feedLink, itemLink)); - assertEquals(msg, expected, actual); - } + @Test + public void testLinkWithFallback() { + String actual = FeedItemUtil.getLinkWithFallback(createFeedItem(feedLink, itemLink)); + assertEquals(msg, expected, actual); + } - private static FeedItem createFeedItem(String feedLink, String itemLink) { - Feed feed = new Feed(); - feed.setLink(feedLink); - FeedItem feedItem = new FeedItem(); - feedItem.setLink(itemLink); - feedItem.setFeed(feed); - feed.setItems(Arrays.asList(feedItem)); - return feedItem; - } + private static FeedItem createFeedItem(String feedLink, String itemLink) { + Feed feed = new Feed(); + feed.setLink(feedLink); + FeedItem feedItem = new FeedItem(); + feedItem.setLink(itemLink); + feedItem.setFeed(feed); + feed.setItems(Arrays.asList(feedItem)); + return feedItem; } } |