Creating integration tests for persistent entities
Spring Roo provides a test
integration
command that simplifies the creation of integration tests for persistent entities. In this recipe, we'll look at how to create an integration test for an entity.
Getting ready
Exit the Roo shell and delete the contents of the C:\roo-cookbook\ch02-recipes
directory.
Execute the ch02_jsr303_fields.roo
script. It creates a flight-app
Roo project and sets up Hibernate as persistence provider using the persistence
setup
command. The script also creates a Flight
entity, which has FlightKey
as its composite primary key class, and adds fields to the Flight
and FlightKey
classes. If you are using a different database than MySQL or your connection settings are different from what is specified in the script, then modify the script accordingly.
Start the Roo shell from the C:\roo-cookbook\ch02-recipes
directory.
How to do it...
The following steps will show you how to create integration tests:
Change the focus of the...