Build Test Data Plugin

  • Tags : testing, data, domain
  • Latest : 2.0.5
  • Last Updated: 19 April 2013
  • Grails version : 2.0.0 > *
18 votes

4% of Grails users

Dependency :
compile ":build-test-data:2.0.5"

Documentation Issues

Summary

Enables the easy creation of test data by automatic inspection of constraints. Any properties that are required have their constraints examined and a value is automatically provided for them.

Installation

grails install-plugin build-test-data

Description

This plugin allows the user to easily create testing data through the use of a "build" method that is added to all Domain Classes. The build method inspects all of the constraints and creates default values for those required properties.

This testing data is much more robust as it changes with the domain classes when new properties and constraints are added. The only tests that will break are the ones directly related to the changes you're making, rather than any test using any part of that domain class.

See the Official Docs for detailed documentation and code samples.

I've also created a blog post showing some of the details of the initial build-test-data release

I've also created a presentation for build-test-data that I presented to the Groovy Users of Minnesota .