diff --git a/api/src/main/java/com/readrops/api/ApiModule.kt b/api/src/main/java/com/readrops/api/ApiModule.kt index 25608f47..f7cf0840 100644 --- a/api/src/main/java/com/readrops/api/ApiModule.kt +++ b/api/src/main/java/com/readrops/api/ApiModule.kt @@ -2,18 +2,18 @@ package com.readrops.api import com.readrops.api.localfeed.LocalRSSDataSource import com.readrops.api.services.Credentials -import com.readrops.api.services.freshrss.NewFreshRSSDataSource -import com.readrops.api.services.freshrss.NewFreshRSSService +import com.readrops.api.services.freshrss.FreshRSSDataSource +import com.readrops.api.services.freshrss.FreshRSSService import com.readrops.api.services.freshrss.adapters.FreshRSSFeedsAdapter import com.readrops.api.services.freshrss.adapters.FreshRSSFoldersAdapter import com.readrops.api.services.freshrss.adapters.FreshRSSItemsAdapter import com.readrops.api.services.freshrss.adapters.FreshRSSItemsIdsAdapter import com.readrops.api.services.freshrss.adapters.FreshRSSUserInfoAdapter -import com.readrops.api.services.nextcloudnews.NewNextcloudNewsDataSource -import com.readrops.api.services.nextcloudnews.NewNextcloudNewsService -import com.readrops.api.services.nextcloudnews.adapters.NextNewsFeedsAdapter -import com.readrops.api.services.nextcloudnews.adapters.NextNewsFoldersAdapter -import com.readrops.api.services.nextcloudnews.adapters.NextNewsItemsAdapter +import com.readrops.api.services.nextcloudnews.NextcloudNewsDataSource +import com.readrops.api.services.nextcloudnews.NextcloudNewsService +import com.readrops.api.services.nextcloudnews.adapters.NextcloudNewsFeedsAdapter +import com.readrops.api.services.nextcloudnews.adapters.NextcloudNewsFoldersAdapter +import com.readrops.api.services.nextcloudnews.adapters.NextcloudNewsItemsAdapter import com.readrops.api.utils.AuthInterceptor import com.readrops.api.utils.ErrorInterceptor import com.readrops.db.entities.Item @@ -46,7 +46,7 @@ val apiModule = module { //region freshrss - factory { params -> NewFreshRSSDataSource(get(parameters = { params })) } + factory { params -> FreshRSSDataSource(get(parameters = { params })) } factory { (credentials: Credentials) -> Retrofit.Builder() @@ -54,7 +54,7 @@ val apiModule = module { .client(get()) .addConverterFactory(MoshiConverterFactory.create(get(named("freshrssMoshi")))) .build() - .create(NewFreshRSSService::class.java) + .create(FreshRSSService::class.java) } single(named("freshrssMoshi")) { @@ -71,7 +71,7 @@ val apiModule = module { //region nextcloud news - factory { params -> NewNextcloudNewsDataSource(get(parameters = { params })) } + factory { params -> NextcloudNewsDataSource(get(parameters = { params })) } factory { (credentials: Credentials) -> Retrofit.Builder() @@ -79,14 +79,14 @@ val apiModule = module { .client(get()) .addConverterFactory(MoshiConverterFactory.create(get(named("nextcloudNewsMoshi")))) .build() - .create(NewNextcloudNewsService::class.java) + .create(NextcloudNewsService::class.java) } single(named("nextcloudNewsMoshi")) { Moshi.Builder() - .add(NextNewsFeedsAdapter()) - .add(NextNewsFoldersAdapter()) - .add(Types.newParameterizedType(List::class.java, Item::class.java), NextNewsItemsAdapter()) + .add(NextcloudNewsFeedsAdapter()) + .add(NextcloudNewsFoldersAdapter()) + .add(Types.newParameterizedType(List::class.java, Item::class.java), NextcloudNewsItemsAdapter()) .build() } diff --git a/api/src/main/java/com/readrops/api/services/Credentials.kt b/api/src/main/java/com/readrops/api/services/Credentials.kt index 33026006..2040f09c 100644 --- a/api/src/main/java/com/readrops/api/services/Credentials.kt +++ b/api/src/main/java/com/readrops/api/services/Credentials.kt @@ -1,9 +1,9 @@ package com.readrops.api.services import com.readrops.api.services.freshrss.FreshRSSCredentials -import com.readrops.api.services.freshrss.NewFreshRSSService -import com.readrops.api.services.nextcloudnews.NewNextcloudNewsService -import com.readrops.api.services.nextcloudnews.NextNewsCredentials +import com.readrops.api.services.freshrss.FreshRSSService +import com.readrops.api.services.nextcloudnews.NextcloudNewsService +import com.readrops.api.services.nextcloudnews.NextcloudNewsCredentials import com.readrops.db.entities.account.Account import com.readrops.db.entities.account.AccountType @@ -15,7 +15,7 @@ abstract class Credentials(val authorization: String?, val url: String) { val endPoint = getEndPoint(account.accountType!!) return when (account.accountType) { - AccountType.NEXTCLOUD_NEWS -> NextNewsCredentials(account.login, account.password, account.url + endPoint) + AccountType.NEXTCLOUD_NEWS -> NextcloudNewsCredentials(account.login, account.password, account.url + endPoint) AccountType.FRESHRSS -> FreshRSSCredentials(account.token, account.url + endPoint) else -> throw IllegalArgumentException("Unknown account type") } @@ -23,8 +23,8 @@ abstract class Credentials(val authorization: String?, val url: String) { private fun getEndPoint(accountType: AccountType): String { return when (accountType) { - AccountType.FRESHRSS -> NewFreshRSSService.END_POINT - AccountType.NEXTCLOUD_NEWS -> NewNextcloudNewsService.END_POINT + AccountType.FRESHRSS -> FreshRSSService.END_POINT + AccountType.NEXTCLOUD_NEWS -> NextcloudNewsService.END_POINT else -> throw IllegalArgumentException("Unknown account type") } } diff --git a/api/src/main/java/com/readrops/api/services/freshrss/NewFreshRSSDataSource.kt b/api/src/main/java/com/readrops/api/services/freshrss/FreshRSSDataSource.kt similarity index 98% rename from api/src/main/java/com/readrops/api/services/freshrss/NewFreshRSSDataSource.kt rename to api/src/main/java/com/readrops/api/services/freshrss/FreshRSSDataSource.kt index 199b9653..f9fec9b7 100644 --- a/api/src/main/java/com/readrops/api/services/freshrss/NewFreshRSSDataSource.kt +++ b/api/src/main/java/com/readrops/api/services/freshrss/FreshRSSDataSource.kt @@ -12,7 +12,7 @@ import okhttp3.MultipartBody import java.io.StringReader import java.util.Properties -class NewFreshRSSDataSource(private val service: NewFreshRSSService) { +class FreshRSSDataSource(private val service: FreshRSSService) { suspend fun login(login: String, password: String): String { val requestBody = MultipartBody.Builder() diff --git a/api/src/main/java/com/readrops/api/services/freshrss/NewFreshRSSService.kt b/api/src/main/java/com/readrops/api/services/freshrss/FreshRSSService.kt similarity index 98% rename from api/src/main/java/com/readrops/api/services/freshrss/NewFreshRSSService.kt rename to api/src/main/java/com/readrops/api/services/freshrss/FreshRSSService.kt index 243f8d44..3dfd0d55 100644 --- a/api/src/main/java/com/readrops/api/services/freshrss/NewFreshRSSService.kt +++ b/api/src/main/java/com/readrops/api/services/freshrss/FreshRSSService.kt @@ -13,7 +13,7 @@ import retrofit2.http.GET import retrofit2.http.POST import retrofit2.http.Query -interface NewFreshRSSService { +interface FreshRSSService { @POST("accounts/ClientLogin") suspend fun login(@Body body: RequestBody?): ResponseBody diff --git a/api/src/main/java/com/readrops/api/services/freshrss/adapters/FreshRSSItemsAdapter.kt b/api/src/main/java/com/readrops/api/services/freshrss/adapters/FreshRSSItemsAdapter.kt index 968651c0..fcc1f51b 100644 --- a/api/src/main/java/com/readrops/api/services/freshrss/adapters/FreshRSSItemsAdapter.kt +++ b/api/src/main/java/com/readrops/api/services/freshrss/adapters/FreshRSSItemsAdapter.kt @@ -1,7 +1,7 @@ package com.readrops.api.services.freshrss.adapters -import com.readrops.api.services.freshrss.NewFreshRSSDataSource.Companion.GOOGLE_READ -import com.readrops.api.services.freshrss.NewFreshRSSDataSource.Companion.GOOGLE_STARRED +import com.readrops.api.services.freshrss.FreshRSSDataSource.Companion.GOOGLE_READ +import com.readrops.api.services.freshrss.FreshRSSDataSource.Companion.GOOGLE_STARRED import com.readrops.api.utils.exceptions.ParseException import com.readrops.api.utils.extensions.nextNonEmptyString import com.readrops.api.utils.extensions.nextNullableString diff --git a/api/src/main/java/com/readrops/api/services/nextcloudnews/NextNewsCredentials.kt b/api/src/main/java/com/readrops/api/services/nextcloudnews/NextcloudNewsCredentials.kt similarity index 66% rename from api/src/main/java/com/readrops/api/services/nextcloudnews/NextNewsCredentials.kt rename to api/src/main/java/com/readrops/api/services/nextcloudnews/NextcloudNewsCredentials.kt index 5c969f4c..dd401d88 100644 --- a/api/src/main/java/com/readrops/api/services/nextcloudnews/NextNewsCredentials.kt +++ b/api/src/main/java/com/readrops/api/services/nextcloudnews/NextcloudNewsCredentials.kt @@ -2,7 +2,7 @@ package com.readrops.api.services.nextcloudnews import com.readrops.api.services.Credentials -class NextNewsCredentials(login: String?, password: String?, url: String): +class NextcloudNewsCredentials(login: String?, password: String?, url: String): Credentials(if (login != null && password != null) { okhttp3.Credentials.basic(login, password) } else null, url) \ No newline at end of file diff --git a/api/src/main/java/com/readrops/api/services/nextcloudnews/NewNextcloudNewsDataSource.kt b/api/src/main/java/com/readrops/api/services/nextcloudnews/NextcloudNewsDataSource.kt similarity index 94% rename from api/src/main/java/com/readrops/api/services/nextcloudnews/NewNextcloudNewsDataSource.kt rename to api/src/main/java/com/readrops/api/services/nextcloudnews/NextcloudNewsDataSource.kt index 38857cc5..c75abfd7 100644 --- a/api/src/main/java/com/readrops/api/services/nextcloudnews/NewNextcloudNewsDataSource.kt +++ b/api/src/main/java/com/readrops/api/services/nextcloudnews/NextcloudNewsDataSource.kt @@ -3,7 +3,7 @@ package com.readrops.api.services.nextcloudnews import com.gitlab.mvysny.konsumexml.konsumeXml import com.readrops.api.services.SyncResult import com.readrops.api.services.SyncType -import com.readrops.api.services.nextcloudnews.adapters.NextNewsUserAdapter +import com.readrops.api.services.nextcloudnews.adapters.NextcloudNewsUserAdapter import com.readrops.db.entities.Feed import com.readrops.db.entities.Folder import com.readrops.db.entities.Item @@ -15,7 +15,7 @@ import kotlinx.coroutines.awaitAll import okhttp3.OkHttpClient import okhttp3.Request -class NewNextcloudNewsDataSource(private val service: NewNextcloudNewsService) { +class NextcloudNewsDataSource(private val service: NextcloudNewsService) { suspend fun login(client: OkHttpClient, account: Account): String { val request = Request.Builder() @@ -26,7 +26,7 @@ class NewNextcloudNewsDataSource(private val service: NewNextcloudNewsService) { val response = client.newCall(request) .execute() - val displayName = NextNewsUserAdapter().fromXml(response.body!!.byteStream().konsumeXml()) + val displayName = NextcloudNewsUserAdapter().fromXml(response.body!!.byteStream().konsumeXml()) response.close() return displayName diff --git a/api/src/main/java/com/readrops/api/services/nextcloudnews/NewNextcloudNewsService.kt b/api/src/main/java/com/readrops/api/services/nextcloudnews/NextcloudNewsService.kt similarity index 98% rename from api/src/main/java/com/readrops/api/services/nextcloudnews/NewNextcloudNewsService.kt rename to api/src/main/java/com/readrops/api/services/nextcloudnews/NextcloudNewsService.kt index 29813af1..1400d9a7 100644 --- a/api/src/main/java/com/readrops/api/services/nextcloudnews/NewNextcloudNewsService.kt +++ b/api/src/main/java/com/readrops/api/services/nextcloudnews/NextcloudNewsService.kt @@ -11,7 +11,7 @@ import retrofit2.http.PUT import retrofit2.http.Path import retrofit2.http.Query -interface NewNextcloudNewsService { +interface NextcloudNewsService { @GET("folders") suspend fun getFolders(): List diff --git a/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsFeedsAdapter.kt b/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsFeedsAdapter.kt similarity index 98% rename from api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsFeedsAdapter.kt rename to api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsFeedsAdapter.kt index 9a523585..1c4cf090 100644 --- a/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsFeedsAdapter.kt +++ b/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsFeedsAdapter.kt @@ -11,7 +11,7 @@ import com.squareup.moshi.JsonReader import com.squareup.moshi.ToJson import java.net.URI -class NextNewsFeedsAdapter { +class NextcloudNewsFeedsAdapter { @ToJson fun toJson(feeds: List): String = "" diff --git a/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsFoldersAdapter.kt b/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsFoldersAdapter.kt similarity index 97% rename from api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsFoldersAdapter.kt rename to api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsFoldersAdapter.kt index a8849472..eb890c14 100644 --- a/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsFoldersAdapter.kt +++ b/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsFoldersAdapter.kt @@ -8,7 +8,7 @@ import com.squareup.moshi.FromJson import com.squareup.moshi.JsonReader import com.squareup.moshi.ToJson -class NextNewsFoldersAdapter { +class NextcloudNewsFoldersAdapter { @ToJson fun toJson(folders: List): String = "" diff --git a/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsItemsAdapter.kt b/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsItemsAdapter.kt similarity index 97% rename from api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsItemsAdapter.kt rename to api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsItemsAdapter.kt index 8543cd86..dd98f628 100644 --- a/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsItemsAdapter.kt +++ b/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsItemsAdapter.kt @@ -12,7 +12,7 @@ import com.squareup.moshi.JsonWriter import org.joda.time.DateTimeZone import org.joda.time.LocalDateTime -class NextNewsItemsAdapter : JsonAdapter>() { +class NextcloudNewsItemsAdapter : JsonAdapter>() { override fun toJson(writer: JsonWriter, value: List?) { // no need of this diff --git a/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsUserAdapter.kt b/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsUserAdapter.kt similarity index 93% rename from api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsUserAdapter.kt rename to api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsUserAdapter.kt index ac35039d..940c18c4 100644 --- a/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsUserAdapter.kt +++ b/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsUserAdapter.kt @@ -6,7 +6,7 @@ import com.readrops.api.localfeed.XmlAdapter import com.readrops.api.utils.exceptions.ParseException import com.readrops.api.utils.extensions.nonNullText -class NextNewsUserAdapter : XmlAdapter { +class NextcloudNewsUserAdapter : XmlAdapter { override fun fromXml(konsumer: Konsumer): String { var displayName: String? = null diff --git a/api/src/test/java/com/readrops/api/services/CredentialsTest.kt b/api/src/test/java/com/readrops/api/services/CredentialsTest.kt index 24b23454..0cab3213 100644 --- a/api/src/test/java/com/readrops/api/services/CredentialsTest.kt +++ b/api/src/test/java/com/readrops/api/services/CredentialsTest.kt @@ -1,7 +1,7 @@ package com.readrops.api.services import com.readrops.api.services.freshrss.FreshRSSCredentials -import com.readrops.api.services.nextcloudnews.NextNewsCredentials +import com.readrops.api.services.nextcloudnews.NextcloudNewsCredentials import org.junit.Test import kotlin.test.assertEquals @@ -17,7 +17,7 @@ class CredentialsTest { @Test fun nextcloudNewsCredentialsTest() { - val credentials = NextNewsCredentials("login", "password", "https://freshrss.org") + val credentials = NextcloudNewsCredentials("login", "password", "https://freshrss.org") assertEquals(credentials.authorization!!, "Basic bG9naW46cGFzc3dvcmQ=") assertEquals(credentials.url, "https://freshrss.org") diff --git a/api/src/test/java/com/readrops/api/services/freshrss/FreshRSSDataSourceTest.kt b/api/src/test/java/com/readrops/api/services/freshrss/FreshRSSDataSourceTest.kt index 1cc882f1..3fac6d89 100644 --- a/api/src/test/java/com/readrops/api/services/freshrss/FreshRSSDataSourceTest.kt +++ b/api/src/test/java/com/readrops/api/services/freshrss/FreshRSSDataSourceTest.kt @@ -24,7 +24,7 @@ import kotlin.test.assertTrue class FreshRSSDataSourceTest : KoinTest { - private lateinit var freshRSSDataSource: NewFreshRSSDataSource + private lateinit var freshRSSDataSource: FreshRSSDataSource private val mockServer = MockWebServer() @get:Rule @@ -36,7 +36,7 @@ class FreshRSSDataSourceTest : KoinTest { .client(get()) .addConverterFactory(MoshiConverterFactory.create(get(named("freshrssMoshi")))) .build() - .create(NewFreshRSSService::class.java) + .create(FreshRSSService::class.java) } }) } @@ -44,7 +44,7 @@ class FreshRSSDataSourceTest : KoinTest { @Before fun before() { mockServer.start(8080) - freshRSSDataSource = NewFreshRSSDataSource(get()) + freshRSSDataSource = FreshRSSDataSource(get()) } @After @@ -122,13 +122,13 @@ class FreshRSSDataSourceTest : KoinTest { .setResponseCode(HttpURLConnection.HTTP_OK) .setBody(Buffer().readFrom(stream))) - val items = freshRSSDataSource.getItems(listOf(NewFreshRSSDataSource.GOOGLE_READ, NewFreshRSSDataSource.GOOGLE_STARRED), 100, 21343321321321) + val items = freshRSSDataSource.getItems(listOf(FreshRSSDataSource.GOOGLE_READ, FreshRSSDataSource.GOOGLE_STARRED), 100, 21343321321321) assertTrue { items.size == 2 } val request = mockServer.takeRequest() with(request.requestUrl!!) { - assertEquals(listOf(NewFreshRSSDataSource.GOOGLE_READ, NewFreshRSSDataSource.GOOGLE_STARRED), queryParameterValues("xt")) + assertEquals(listOf(FreshRSSDataSource.GOOGLE_READ, FreshRSSDataSource.GOOGLE_STARRED), queryParameterValues("xt")) assertEquals("100", queryParameter("n")) assertEquals("21343321321321", queryParameter("ot")) @@ -157,13 +157,13 @@ class FreshRSSDataSourceTest : KoinTest { .setResponseCode(HttpURLConnection.HTTP_OK) .setBody(Buffer().readFrom(stream))) - val ids = freshRSSDataSource.getItemsIds(NewFreshRSSDataSource.GOOGLE_READ, NewFreshRSSDataSource.GOOGLE_READING_LIST, 100) + val ids = freshRSSDataSource.getItemsIds(FreshRSSDataSource.GOOGLE_READ, FreshRSSDataSource.GOOGLE_READING_LIST, 100) assertTrue { ids.size == 5 } val request = mockServer.takeRequest() with(request.requestUrl!!) { - assertEquals(NewFreshRSSDataSource.GOOGLE_READ, queryParameter("xt")) - assertEquals(NewFreshRSSDataSource.GOOGLE_READING_LIST, queryParameter("s")) + assertEquals(FreshRSSDataSource.GOOGLE_READ, queryParameter("xt")) + assertEquals(FreshRSSDataSource.GOOGLE_READING_LIST, queryParameter("s")) assertEquals("100", queryParameter("n")) } } @@ -178,7 +178,7 @@ class FreshRSSDataSourceTest : KoinTest { with(request.body.readUtf8()) { assertTrue { contains("T=token") } - assertTrue { contains("s=${URLEncoder.encode("${NewFreshRSSDataSource.FEED_PREFIX}https://feed.url", "UTF-8")}") } + assertTrue { contains("s=${URLEncoder.encode("${FreshRSSDataSource.FEED_PREFIX}https://feed.url", "UTF-8")}") } assertTrue { contains("ac=subscribe") } } } @@ -193,7 +193,7 @@ class FreshRSSDataSourceTest : KoinTest { with(request.body.readUtf8()) { assertTrue { contains("T=token") } - assertTrue { contains("s=${URLEncoder.encode("${NewFreshRSSDataSource.FEED_PREFIX}https://feed.url", "UTF-8")}") } + assertTrue { contains("s=${URLEncoder.encode("${FreshRSSDataSource.FEED_PREFIX}https://feed.url", "UTF-8")}") } assertTrue { contains("ac=unsubscribe") } } } @@ -208,7 +208,7 @@ class FreshRSSDataSourceTest : KoinTest { with(request.body.readUtf8()) { assertTrue { contains("T=token") } - assertTrue { contains("s=${URLEncoder.encode("${NewFreshRSSDataSource.FEED_PREFIX}https://feed.url", "UTF-8")}") } + assertTrue { contains("s=${URLEncoder.encode("${FreshRSSDataSource.FEED_PREFIX}https://feed.url", "UTF-8")}") } assertTrue { contains("t=title") } assertTrue { contains("a=folderId") } assertTrue { contains("ac=edit") } @@ -225,7 +225,7 @@ class FreshRSSDataSourceTest : KoinTest { with(request.body.readUtf8()) { assertTrue { contains("T=token") } - assertTrue { contains("a=${URLEncoder.encode("${NewFreshRSSDataSource.FOLDER_PREFIX}folder", "UTF-8")}") } + assertTrue { contains("a=${URLEncoder.encode("${FreshRSSDataSource.FOLDER_PREFIX}folder", "UTF-8")}") } } } @@ -240,7 +240,7 @@ class FreshRSSDataSourceTest : KoinTest { with(request.body.readUtf8()) { assertTrue { contains("T=token") } assertTrue { contains("s=folderId") } - assertTrue { contains("dest=${URLEncoder.encode("${NewFreshRSSDataSource.FOLDER_PREFIX}folder", "UTF-8")}") } + assertTrue { contains("dest=${URLEncoder.encode("${FreshRSSDataSource.FOLDER_PREFIX}folder", "UTF-8")}") } } } diff --git a/api/src/test/java/com/readrops/api/services/nextcloudnews/NextcloudNewsDataSourceTest.kt b/api/src/test/java/com/readrops/api/services/nextcloudnews/NextcloudNewsDataSourceTest.kt index 5075596d..2fe6109e 100644 --- a/api/src/test/java/com/readrops/api/services/nextcloudnews/NextcloudNewsDataSourceTest.kt +++ b/api/src/test/java/com/readrops/api/services/nextcloudnews/NextcloudNewsDataSourceTest.kt @@ -25,7 +25,7 @@ import kotlin.test.assertTrue class NextcloudNewsDataSourceTest : KoinTest { - private lateinit var nextcloudNewsDataSource: NewNextcloudNewsDataSource + private lateinit var nextcloudNewsDataSource: NextcloudNewsDataSource private val mockServer = MockWebServer() private val moshi = Moshi.Builder() .build() @@ -39,7 +39,7 @@ class NextcloudNewsDataSourceTest : KoinTest { .client(get()) .addConverterFactory(MoshiConverterFactory.create(get(named("nextcloudNewsMoshi")))) .build() - .create(NewNextcloudNewsService::class.java) + .create(NextcloudNewsService::class.java) } }) } @@ -47,7 +47,7 @@ class NextcloudNewsDataSourceTest : KoinTest { @Before fun before() { mockServer.start(8080) - nextcloudNewsDataSource = NewNextcloudNewsDataSource(get()) + nextcloudNewsDataSource = NextcloudNewsDataSource(get()) } @After @@ -93,7 +93,7 @@ class NextcloudNewsDataSourceTest : KoinTest { val stream = TestUtils.loadResource("services/nextcloudnews/adapters/items.json") mockServer.enqueueStream(stream) - val items = nextcloudNewsDataSource.getItems(NewNextcloudNewsDataSource.ItemQueryType.ALL.value, false, 10) + val items = nextcloudNewsDataSource.getItems(NextcloudNewsDataSource.ItemQueryType.ALL.value, false, 10) val request = mockServer.takeRequest() assertTrue { items.size == 3 } @@ -110,7 +110,7 @@ class NextcloudNewsDataSourceTest : KoinTest { mockServer.enqueueStream(stream) val items = - nextcloudNewsDataSource.getNewItems(1512, NewNextcloudNewsDataSource.ItemQueryType.ALL) + nextcloudNewsDataSource.getNewItems(1512, NextcloudNewsDataSource.ItemQueryType.ALL) val request = mockServer.takeRequest() assertTrue { items.size == 3 } diff --git a/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsFeedsAdapterTest.kt b/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsFeedsAdapterTest.kt similarity index 93% rename from api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsFeedsAdapterTest.kt rename to api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsFeedsAdapterTest.kt index 96fc9389..c7fc1300 100644 --- a/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsFeedsAdapterTest.kt +++ b/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsFeedsAdapterTest.kt @@ -9,10 +9,10 @@ import org.junit.Assert.assertEquals import org.junit.Assert.assertNull import org.junit.Test -class NextNewsFeedsAdapterTest { +class NextcloudNewsFeedsAdapterTest { private val adapter = Moshi.Builder() - .add(NextNewsFeedsAdapter()) + .add(NextcloudNewsFeedsAdapter()) .build() .adapter>(Types.newParameterizedType(List::class.java, Feed::class.java)) diff --git a/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsFoldersAdapterTest.kt b/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsFoldersAdapterTest.kt similarity index 92% rename from api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsFoldersAdapterTest.kt rename to api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsFoldersAdapterTest.kt index be58847d..8a69df69 100644 --- a/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsFoldersAdapterTest.kt +++ b/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsFoldersAdapterTest.kt @@ -10,10 +10,10 @@ import okio.Buffer import org.junit.Assert.assertThrows import org.junit.Test -class NextNewsFoldersAdapterTest { +class NextcloudNewsFoldersAdapterTest { private val adapter = Moshi.Builder() - .add(NextNewsFoldersAdapter()) + .add(NextcloudNewsFoldersAdapter()) .build() .adapter>(Types.newParameterizedType(List::class.java, Folder::class.java)) diff --git a/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsItemsAdapterTest.kt b/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsItemsAdapterTest.kt similarity index 94% rename from api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsItemsAdapterTest.kt rename to api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsItemsAdapterTest.kt index 2e91b44e..c68dbd1c 100644 --- a/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsItemsAdapterTest.kt +++ b/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsItemsAdapterTest.kt @@ -9,10 +9,10 @@ import okio.Buffer import org.joda.time.LocalDateTime import org.junit.Test -class NextNewsItemsAdapterTest { +class NextcloudNewsItemsAdapterTest { private val adapter = Moshi.Builder() - .add(Types.newParameterizedType(List::class.java, Item::class.java), NextNewsItemsAdapter()) + .add(Types.newParameterizedType(List::class.java, Item::class.java), NextcloudNewsItemsAdapter()) .build() .adapter>(Types.newParameterizedType(List::class.java, Item::class.java)) diff --git a/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsUserAdapterTest.kt b/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsUserAdapterTest.kt similarity index 81% rename from api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsUserAdapterTest.kt rename to api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsUserAdapterTest.kt index 03c3d7c3..2495f684 100644 --- a/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsUserAdapterTest.kt +++ b/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextcloudNewsUserAdapterTest.kt @@ -5,9 +5,9 @@ import com.readrops.api.TestUtils import org.junit.Assert.assertEquals import org.junit.Test -class NextNewsUserAdapterTest { +class NextcloudNewsUserAdapterTest { - private val adapter = NextNewsUserAdapter() + private val adapter = NextcloudNewsUserAdapter() @Test fun validXmlTest() { diff --git a/app/src/main/java/com/readrops/app/repositories/FreshRSSRepository.kt b/app/src/main/java/com/readrops/app/repositories/FreshRSSRepository.kt index 47947cbb..25d27bf4 100644 --- a/app/src/main/java/com/readrops/app/repositories/FreshRSSRepository.kt +++ b/app/src/main/java/com/readrops/app/repositories/FreshRSSRepository.kt @@ -4,7 +4,7 @@ import com.readrops.api.services.Credentials import com.readrops.api.services.SyncResult import com.readrops.api.services.SyncType import com.readrops.api.services.freshrss.FreshRSSSyncData -import com.readrops.api.services.freshrss.NewFreshRSSDataSource +import com.readrops.api.services.freshrss.FreshRSSDataSource import com.readrops.api.utils.AuthInterceptor import com.readrops.app.util.Utils import com.readrops.db.Database @@ -19,7 +19,7 @@ import org.koin.core.component.KoinComponent class FreshRSSRepository( database: Database, account: Account, - private val dataSource: NewFreshRSSDataSource, + private val dataSource: FreshRSSDataSource, ) : BaseRepository(database, account), KoinComponent { override suspend fun login(account: Account) { @@ -113,7 +113,7 @@ class FreshRSSRepository( override suspend fun updateFolder(folder: Folder) { dataSource.updateFolder(account.writeToken!!, folder.remoteId!!, folder.name!!) - folder.remoteId = NewFreshRSSDataSource.FOLDER_PREFIX + folder.name + folder.remoteId = FreshRSSDataSource.FOLDER_PREFIX + folder.name super.updateFolder(folder) } diff --git a/app/src/main/java/com/readrops/app/repositories/NextcloudNewsRepository.kt b/app/src/main/java/com/readrops/app/repositories/NextcloudNewsRepository.kt index 9f6c4d32..27df2a73 100644 --- a/app/src/main/java/com/readrops/app/repositories/NextcloudNewsRepository.kt +++ b/app/src/main/java/com/readrops/app/repositories/NextcloudNewsRepository.kt @@ -3,7 +3,7 @@ package com.readrops.app.repositories import com.readrops.api.services.Credentials import com.readrops.api.services.SyncResult import com.readrops.api.services.SyncType -import com.readrops.api.services.nextcloudnews.NewNextcloudNewsDataSource +import com.readrops.api.services.nextcloudnews.NextcloudNewsDataSource import com.readrops.api.services.nextcloudnews.NextcloudNewsSyncData import com.readrops.api.utils.AuthInterceptor import com.readrops.app.util.Utils @@ -24,7 +24,7 @@ import org.koin.core.component.get class NextcloudNewsRepository( database: Database, account: Account, - private val dataSource: NewNextcloudNewsDataSource, + private val dataSource: NextcloudNewsDataSource, private val dispatcher: CoroutineDispatcher = Dispatchers.IO ) : BaseRepository(database, account), KoinComponent {