What is the proper way to test a property of an argument passed into a method of a mock, under JMock 2.5?
Let's say that my CUT would normally be called like:
myObject.myMethod(arg);
and I'd like to verify that "arg" is of a particular type, and that it has a particular property set. I'm trying to do this:
one(mock).myMethod(with(hasProperty("prop", eq("value"))));
but hasProperty() returns Object, while myMethod() is expecting type Argument.
I *can* do the following, which works:
one(mock).myMethod(with(any(Argument.class)));
I've been googling this problem for 2 days now, so any help would be greatly appreciated, thanks.