PR#98 Fix code analysis errors
This commit is contained in:
parent
7e019973e8
commit
8ec369f3e7
9 changed files with 14 additions and 18 deletions
|
|
@ -12,7 +12,8 @@ import org.junit.jupiter.api.extension.ExtensionContext
|
|||
*
|
||||
* reference: https://developer.android.com/reference/androidx/arch/core/executor/testing/InstantTaskExecutorRule
|
||||
*
|
||||
* A JUnit5 Extensions that swaps the background executor used by the Architecture Components with a different one which executes each task synchronously.
|
||||
* A JUnit5 Extensions that swaps the background executor used by the Architecture Components with a different
|
||||
* one which executes each task synchronously.
|
||||
* You can use this extension for your host side tests that use Architecture Components.
|
||||
*/
|
||||
@SuppressLint("RestrictedApi")
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ abstract class TestMainDispatcher : BeforeEachCallback, AfterEachCallback {
|
|||
|
||||
protected abstract var createdTestDispatcher: TestDispatcher?
|
||||
|
||||
abstract fun createDispatcher() : TestDispatcher
|
||||
abstract fun createDispatcher(): TestDispatcher
|
||||
|
||||
final override fun beforeEach(context: ExtensionContext?) {
|
||||
val testDispatcher = createDispatcher()
|
||||
|
|
@ -29,4 +29,4 @@ abstract class TestMainDispatcher : BeforeEachCallback, AfterEachCallback {
|
|||
Dispatchers.resetMain()
|
||||
createdTestDispatcher = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue