Using Mokito, how do I match against the key-value pair of a map?

Posted by Sean on Stack Overflow See other posts from Stack Overflow or by Sean
Published on 2010-04-05T18:52:56Z Indexed on 2010/04/05 19:03 UTC
Read the original article Hit count: 228

Filed under:
|
|

I am need to send a return specific value from a mock object based on a specific key value.

concreate class:

map.put("xpath", "PRICE");
search(map);

Test case:

IOurXMLDocument mock = mock(IOurXMLDocument.class);
when(mock.search(.....need help here).thenReturn("$100.00");

how do I mock this method call for this key value pair?

© Stack Overflow or respective owner

Related posts about java

Related posts about beginner