diff options
3 files changed, 13 insertions, 11 deletions
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/shared/model/ApiVersion.java b/app/src/main/java/it/niedermann/owncloud/notes/shared/model/ApiVersion.java index 0f8b7c1c..0a42012b 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/shared/model/ApiVersion.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/shared/model/ApiVersion.java @@ -41,10 +41,6 @@ public class ApiVersion implements Comparable<ApiVersion> { return minor; } - public String getOriginalVersion() { - return originalVersion; - } - public static ApiVersion of(String versionString) { int major = 0, minor = 0; if (versionString != null) { diff --git a/app/src/main/java/it/niedermann/owncloud/notes/shared/model/CategorySortingMethod.java b/app/src/main/java/it/niedermann/owncloud/notes/shared/model/CategorySortingMethod.java index 94bcda38..6a36ade1 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/shared/model/CategorySortingMethod.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/shared/model/CategorySortingMethod.java @@ -7,7 +7,7 @@ public enum CategorySortingMethod { private final int id; private final String title; // sorting method OrderBy for SQL - /*** + /** * Constructor * @param title given sorting method OrderBy */ @@ -16,7 +16,7 @@ public enum CategorySortingMethod { this.title = title; } - /*** + /** * Retrieve the sorting method id represented in database * @return the sorting method id for the enum item */ @@ -24,7 +24,7 @@ public enum CategorySortingMethod { return this.id; } - /*** + /** * Retrieve the sorting method order for SQL * @return the sorting method order for the enum item */ @@ -32,7 +32,7 @@ public enum CategorySortingMethod { return this.title; } - /*** + /** * Retrieve the corresponding enum value with given the index (ordinal) * @param id the id of the corresponding enum value stored in DB * @return the corresponding enum item with the index (ordinal) diff --git a/app/src/test/java/it/niedermann/owncloud/notes/persistence/NotesRepositoryTest.java b/app/src/test/java/it/niedermann/owncloud/notes/persistence/NotesRepositoryTest.java index fca1ce4a..5aaf5cc6 100644 --- a/app/src/test/java/it/niedermann/owncloud/notes/persistence/NotesRepositoryTest.java +++ b/app/src/test/java/it/niedermann/owncloud/notes/persistence/NotesRepositoryTest.java @@ -9,7 +9,6 @@ import androidx.room.Room; import androidx.test.core.app.ApplicationProvider; import com.google.common.util.concurrent.MoreExecutors; -import com.nextcloud.android.sso.exceptions.NextcloudHttpRequestFailedException; import org.json.JSONException; import org.junit.After; @@ -26,7 +25,6 @@ import java.lang.reflect.InvocationTargetException; import java.util.Arrays; import java.util.Calendar; import java.util.Map; -import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; import it.niedermann.owncloud.notes.persistence.entity.Account; @@ -39,8 +37,9 @@ import static it.niedermann.owncloud.notes.shared.model.DBStatus.LOCAL_DELETED; import static it.niedermann.owncloud.notes.shared.model.DBStatus.LOCAL_EDITED; import static it.niedermann.owncloud.notes.shared.model.DBStatus.VOID; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertSame; import static org.junit.Assert.fail; @RunWith(RobolectricTestRunner.class) @@ -112,6 +111,13 @@ public class NotesRepositoryTest { } @Test + public void testGetInstance() { + final NotesRepository repo = NotesRepository.getInstance(ApplicationProvider.getApplicationContext()); + assertNotNull("Result of NotesRepository.getInstance() must not be null", repo); + assertSame("Result of NotesRepository.getInstance() must always return the same instance", repo, NotesRepository.getInstance(ApplicationProvider.getApplicationContext())); + } + + @Test public void testGetIdMap() { final Map<Long, Long> idMapOfFirstAccount = repo.getIdMap(account.getId()); assertEquals(3, idMapOfFirstAccount.size()); |