Integration Testing
We create an integration test by running the Grails script create-integration-test. An integration test is a Spock specification or JUnit test case, just like a Grails unit test. The difference is in what is available to the test at runtime. Unit tests are meant to test a unit (class) in isolation, so Grails doesn’t give unit tests any of its dynamic goodness. Integration tests are meant to test multiple classes working together. When running integration tests, Grails adds all of the dynamic behavior that we’re taking advantage of in our application.
Since the process of adding default tasks to an event involves the TaskService, Task, and TekEvent classes, an integration test is a good fit. Run the create-integration-test ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access