Showing posts with label roo in action. Show all posts
Showing posts with label roo in action. Show all posts

Monday, July 25, 2011

Roo In Action Corner - Testing Entity Validations With A Mock Entity

This article references the Manning book Spring Roo in Action, which Ken Rimple is currently authoring.  It is available as a Manning MEAP.

I've been working hard on the more advanced chapters of Roo in Action, and as part of this I've amassed some background material that didn't make it into the book.  This topic, using Spring's Mock Entity support, was one of those topics that didn't get a lot of attention.
In Spring Roo in Action, Chapter 3, I discuss how Roo automatically executes the Bean Validators when persisting a live entity. However, when running unit tests, we don't have a live entity at all, nor do we have a Spring container - so how can we exercise the validation without actually hitting our Roo application and the database?