Monday, March 5, 2018

mock vs spy

mock: fake object, everything will be null-> every property, every method call will be null, unless you specify what will be returned for that property, or for that method

spy: real object, but can be partially mocked-> everything exists, real property, real method call will be performed, unless you define what will be returned for that property, or for that method.

No comments:

Post a Comment

java special for collection size, array size, and string size

Size: For Collections (eg: Map, List, etc ): usually it use collection.size(), eg         Map<Character, Integer> map ...