Testing data classes in Kotlin
As we all know, data classes are final by default on Kotlin and if you try to use Mockito and mock such a class, you will get an exception. What you need to do is add this file:
Continue reading “Tricky parts when implementing unit tests for Android in Kotlin”
Running unit tests for ViewModels on Android where you have LiveData objects can be tricky. It is very possible that you get this exception:
java.lang.RuntimeException: Method getMainLooper in android.os.Looper not mocked.
Continue reading “Running unit tests for LiveData with Jupiter on Android”
In Android we decided that we want to implement a unit test performance monitor. The reason for it is that sometimes some unit tests would execute in more than 1 second and it was all because we would use the Schedulers.trampoline() RxJava scheduler instead of the TestScheduler which is part of the RX package.
Continue reading “Creating a SonarQube custom plugin for Kotlin”
Using RxJava with the architecture components from Google in the latest project that I was working on, it made me think how does error handling fit with the LiveData and can you keep the RxJava error handling which I find quite nice.
Continue reading “RxJava & LiveData combined error handling”