-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Convert from Mockito to Mockk and Assertj to assertk
- Loading branch information
1 parent
2aef511
commit 1ef2161
Showing
10 changed files
with
641 additions
and
607 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
serenity-app/src/test/kotlin/us/nineworlds/serenity/MockkTestingModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package us.nineworlds.serenity | ||
|
||
import android.content.Context | ||
import androidx.localbroadcastmanager.content.LocalBroadcastManager | ||
import com.birbit.android.jobqueue.JobManager | ||
import io.mockk.mockk | ||
import toothpick.config.Module | ||
import us.nineworlds.serenity.common.rest.SerenityClient | ||
import us.nineworlds.serenity.core.logger.Logger | ||
import us.nineworlds.serenity.core.util.AndroidHelper | ||
|
||
class MockkTestingModule : Module() { | ||
companion object { | ||
val mockJobManager: JobManager = mockk(relaxed = true) | ||
val mockPlexAppFactory: SerenityClient = mockk(relaxed = true) | ||
val mockLocalBroadcastManager: LocalBroadcastManager = mockk(relaxed = true) | ||
var mockLogger: Logger = mockk(relaxed = true) | ||
var mockAndroidHelper: AndroidHelper = mockk(relaxed = true) | ||
} | ||
|
||
init { | ||
bind(JobManager::class.java).toInstance(mockJobManager) | ||
bind(SerenityClient::class.java).toInstance(mockPlexAppFactory) | ||
bind(LocalBroadcastManager::class.java).toInstance(mockLocalBroadcastManager) | ||
bind(Logger::class.java).toInstance(mockLogger) | ||
bind(AndroidHelper::class.java).toInstance(mockAndroidHelper) | ||
} | ||
} |
Oops, something went wrong.