I have a function here which gets the list of Posts from JSONplaceholder api. If want to implement testing on this function how do I do it and what will I need, Mockito, JUnit
override fun getAllPosts(): Flowable<List<PostEntity>> {
return postsService.getPosts()
.flatMap { posts ->
Flowable.fromIterable(posts)
.take(10)
.toList().toFlowable()
}
}
@GET("/posts")
fun getPosts(): Flowable<List<PostEntity>>
Please give me some pointers on how do I go about doing testing it in Android studio
Thanks R