I have a trait
trait Writer[T <: Attribute] {
def read(boundingBox: BoundingBox): Future[List[T]]
}
and a case class
case class WriterImpl[T <: Attribute]()(implicit manifest: Manifest[T]) extends Writer[T] with LazyLogging {
override def read(boundingBox: BoundingBox): Future[List[T]] = {
}
..
}
In the Test class I want to mock the method read()
I tried this with exact values
val writer = mock[WriterImpl[Attrib]]
when(writer.read(new BoundingBox(41.90178412, 41.8798685, -87.62687021, -87.64884287)))
.thenReturn(Future.successful(scala.collection.immutable.List(list)))
verify(writer).read(new BoundingBox(41.90178412, 41.8798685, -87.62687021, -87.64884287))
also tried
val writer = mock[WriterImpl[Attrib]]
when(writer.read(ArgumentMatchers.any()))
.thenReturn(Future.successful(scala.collection.immutable.List(list)))
verify(writer).read(ArgumentMatchers.any())
Instead of calling the mock method it calls the actual method