mockingguidewiregosugunit

GUnit and Mocking frameworks


Guidewire cloud standards states that mocking (mockito, easymock etc.) is not fully supported and test stubs are recommended. Is that right and why?

We are planning to build a new Unit testing suite on Guidewire for PC, BC, CC. Also looking at migrating the applications to Cloud.


Solution

  • That is correct Ajith, Guidewire platform have never fully supported mocking. The main reason lays in the construction of the persistence framework and the lack of dependency injection throughout the platform. Funny enough there are easymock libraries shipped with the OOTB There are some successful attempts that I've made (and others I know) in the past to mock certain aspects in GOSU and they work fine. However when you try to do things like entity mocking of enhancements mocking then you will struggle big time and you are most likely to end up nowhere. Let me know if you need any further delve into the topic.