Testing web applications is notorious for being harder than testing other kinds of applications. This is because web applications run in an environment in which the application has access to various specific web objects such as the user’s session, HTTP requests, responses, and parameters. So testing the application in isolation can be quite difficult. Moreover, it’s usually not easy to mock a web application environment to provide a dummy implementation. Grails makes testing web applications a whole lot easier thanks to its dynamic nature and its use of the highly dynamic Groovy language. Grails enables you to run your tests in a testing environment that simulates a web environment and provides full access to all of Grails’ dynamic objects. Grails also makes it easy to mock any object or method by using Groovy mocks or the ExpandoMetaClass.
KeywordsFunctional Test Unit Test Dynamic Object Full Access Integration Test
Unable to display preview. Download preview PDF.