Cleanup MangaSource fields

This commit is contained in:
Koitharu
2022-01-16 19:19:40 +02:00
parent ba30690d26
commit 722b6d1e59
14 changed files with 41 additions and 60 deletions

View File

@@ -31,7 +31,7 @@ class RemoteMangaRepositoryTest(private val source: MangaSource) : KoinTest {
@get:Rule
val koinTestRule = KoinTestRule.create {
printLogger(Level.ERROR)
modules(repositoryTestModule)
modules(repositoryTestModule, parserModule)
}
@get:Rule

View File

@@ -7,7 +7,6 @@ import org.koitharu.kotatsu.base.domain.MangaLoaderContext
import org.koitharu.kotatsu.core.model.MangaSource
import org.koitharu.kotatsu.core.network.TestCookieJar
import org.koitharu.kotatsu.core.network.UserAgentInterceptor
import org.koitharu.kotatsu.core.parser.RemoteMangaRepository
import org.koitharu.kotatsu.core.parser.SourceSettingsStub
import org.koitharu.kotatsu.core.prefs.SourceSettings
import java.util.concurrent.TimeUnit
@@ -31,12 +30,4 @@ val repositoryTestModule
}
}
}
factory { (source: MangaSource) ->
runCatching {
source.cls.getDeclaredConstructor(MangaLoaderContext::class.java)
.newInstance(get<MangaLoaderContext>())
}.recoverCatching {
source.cls.newInstance()
}.getOrThrow() as RemoteMangaRepository
}
}