I have a scala class A and there is a method doSomething
in it.
There is another class B
class B(name: String)
there is another class C
class C {
def doSomethingElse(b: B): String {
/// some logic
////
}
}
class A(c: C) {
def doSomething(uuid: UUID): String {
val b = new B("hello)
c.doSomethingElse(b)
// some logic
}
}
Now I want to test the method doSomething
of class A using scalatest and scalamock
and I tried to mock the call doSomethingElse
val mockC = mock[C]
val b = new B("hello")
(mockC.doSomethingElse _).expects(b).returning("A");
but when the actual call happens , the mock does not get satisfied because the object of B
is different. Is there a way to express this mock so that it gets satisfied ?