Cleanup MangaSource fields
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user