<How can mock repository.findAll().stream().map{}....
# stackoverflow
u
How can mock repository.findAll().stream().map{}.filter{} I'm having trouble mocking my unit test. I can only mock findAll, but I am not able to mock findAll along with the other methods, stream, map and filter. What would the correct form of the syntax look like: whenever(productRerpository.findAll).thenReturn(product)? Below is my function inside the service class. fun getProductList(userId: Int?, filter: ProductBaseFilter): List { val productCompleteDtoList = productRepository.findAll() .stream() .map {...