If you are using Mockito, it is sometimes useful to check the parameter state of a method passed to a mocked method call. I use it in the following cases DAO method, like create or update is called in the code. I want to check, if the entity has been set correctly before writing into… Continue reading Checking parameter of a mocked method call with Mockito
Tag: Unit test
Using reflection in setup phase of unit testing
It is a common practice to use mock framework in the setup phase of a unit test, in order to set the internal state of the dependent objects. Sometimes it is though easier to set a value of a given field directly, in order to test the class accordingly. For modifying field value via reflection,… Continue reading Using reflection in setup phase of unit testing