From f309b4637be11ce7b740e7dc843936fb707ecfb1 Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Thu, 1 Jan 2015 22:30:52 +0100 Subject: use more nullable annotations * make the DataStore methods use explicit nullable or nonnull return values * remove the null return of getStoredList() * unfortunately many of the test methods need an assert() statement to make Eclipse understand the null logic --- tests/src/cgeo/geocaching/DataStoreTest.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/src/cgeo/geocaching/DataStoreTest.java') diff --git a/tests/src/cgeo/geocaching/DataStoreTest.java b/tests/src/cgeo/geocaching/DataStoreTest.java index 03713ac..36bfe47 100644 --- a/tests/src/cgeo/geocaching/DataStoreTest.java +++ b/tests/src/cgeo/geocaching/DataStoreTest.java @@ -59,6 +59,8 @@ public class DataStoreTest extends CGeoTestCase { // get list final StoredList list1 = DataStore.getList(listId1); + assert (list1 != null); + assertThat(list1).isNotNull(); assertThat(list1.title).isEqualTo("DataStore Test (renamed)"); // move to list (cache1=listId2, cache2=listId2) @@ -123,6 +125,8 @@ public class DataStoreTest extends CGeoTestCase { try { DataStore.saveCache(cache, EnumSet.of(SaveFlag.DB)); final Geocache loadedCache = DataStore.loadCache(GEOCODE_CACHE, LoadFlags.LOAD_ALL_DB_ONLY); + assert (loadedCache != null); + assertThat(loadedCache).isNotNull(); assertThat(loadedCache).overridingErrorMessage("Cache was not saved.").isNotNull(); assertThat(loadedCache.getInventory()).hasSize(1); } finally { -- cgit v1.1