rtens/mockster — pull request #5 by jwoschitz (2014-04-16 21:56:08+00:00)
Title: Test if return value of mocked methods matches type hint

This pull request is implementing the requested feature in https://github.com/rtens/mockster/issues/1

If a mocked method is invoked and returns a custom defined value (via behaviour) the returned value will be evaluated. If the value does not match any of the given type hints an InvalidArgumentException will be thrown.

See tests for further details.

Additionally this PR contains the following changes:
* extracted the logic to parse type hints and suggest a matching default in the MethodTypeHint class
* if the method is invoked multiple times, the parsing of the type hints (and also resolution of a suitable default value) will happen only once