Top 4 Kotlin mockito-kotlin Projects
-
DeezerClone
This Application using Dagger Hilt, Coroutines, Flow, Jetpack (Room, ViewModel, LiveData),Navigation based on MVVM architecture.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Project mention: Best practices for Unit Testing Android Apps with Mockk, Kotest and others | dev.to | 2023-05-10As you can see, I create mockUsersRepository object using mock( function. Then, in setup() method, I set up this repository in such a way so that it would return a list of hardcoded values. After this, on top of everything else, I check if, for mockUsersRepository object, getUsers method was called with verify function, in the test method. It’s important to note that Mockito is a very old framework and was originally written for Java. When Kotlin appeared, it turned out that out of the box this framework can work with some limitations, which is why an extension, mockito-kotlin, was released. The example above was written with it. Another Mockito’s limitation was that it was impossible to mock final classes and static methods, and all classes are final by default in Kotlin. Currently, this is solved through mockito-inline but, before, it was a serious limitation. In respect to Java development, there was and is an alternative for Android developers, PowerMock.
Kotlin mockito-kotlin related posts
Index
What are some of the best open-source mockito-kotlin projects in Kotlin? This list will help you:
Project | Stars | |
---|---|---|
1 | mockito-kotlin | 3,071 |
2 | DeezerClone | 92 |
3 | TestIt | 42 |
4 | Dice | 31 |