GithubTrending
GithubTrending copied to clipboard
An Android project for the Caster.io course on clean architecture
版本: 3.1.3 
When clicking on bookmark project for the first time the app run the bookmark icon don't change , when I clicked on bookmarked projects action menu then return or launch...
Where should I handle Rxjava disposables in domain layer usecase "interactors" or ViewModels? What is better ? I know that you can dispose when onCleared method on viewModel is called.
I'm trying to run test included in the domain layer but all of them fails with this error `Process finished with exit code 1 Class not found: "co.joebirch.domain.interactor.bookmark.BookmarkProjectTest"Empty test suite....
https://github.com/hitherejoe/GithubTrending/blob/da09a1dfcf39e84a8b29173d12fee7afd5790023/cache/src/test/java/co/joebirch/cache/ProjectsCacheImplTest.kt#L98 java.lang.AssertionError: Expected: false (class: Boolean), Actual: [] (latch = 1, values = 0, errors = 0, completions = 0) at io.reactivex.observers.BaseTestConsumer.fail(BaseTestConsumer.java:162) at io.reactivex.observers.BaseTestConsumer.assertValue(BaseTestConsumer.java:327) at com.nygma.cache.ProjectsCacheImplTest.isProjectsCacheExpiredReturnsNotExpired(ProjectsCacheImplTest.kt:99) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at...
https://github.com/hitherejoe/GithubTrending/blob/da09a1dfcf39e84a8b29173d12fee7afd5790023/cache/src/test/java/co/joebirch/cache/ProjectsCacheImplTest.kt#L47 java.lang.AssertionError: Expected: [com.data.model.ProjectEntity@57fbc06f] (class: SingletonList), Actual: [com.data.model.ProjectEntity@51a18b21] (class: ArrayList) (latch = 1, values = 1, errors = 0, completions = 0) at io.reactivex.observers.BaseTestConsumer.fail(BaseTestConsumer.java:162) at io.reactivex.observers.BaseTestConsumer.assertValue(BaseTestConsumer.java:331) at com.nygma.cache.ProjectsCacheImplTest.getProjectsReturnsData(ProjectsCacheImplTest.kt:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native...
https://github.com/hitherejoe/GithubTrending/blob/02ae6cd2fed321da48bdace13815709f43921a7f/Data/src/test/java/co/joebirch/data/ProjectsDataRepositoryTest.kt#L96 Issue: 2 tests were failing 1. `bookmarkProjectCompletes` You should be using `factory.getCacheDataStore().setProjectAsBookmarked(any())` instead of `cache.setProjectAsBookmarked(any())` ``` private fun stubBookmarkProject(completable: Completable) { whenever(factory.getCacheDataStore().setProjectAsBookmarked(any())).thenReturn(completable) } ``` 2. `unbookmarkProjectCompletes` Same
Tests sometimes pass and some times don't.
org.mockito.exceptions.base.MockitoException: Cannot mock/spy class com.nygma.data.store.ProjectsCacheDataStore Mockito cannot mock/spy because : - final class at com.nygma.data.store.ProjectsRemoteDataStoreTest.(ProjectsRemoteDataStoreTest.kt:30) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:217) at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:266) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)...