-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Documentation on how to use it in a unit test for a controller with usage of deep objects #23
Comments
On 18.09.2014 17:53, langerc wrote:
|
On 18.09.2014 17:53, langerc wrote:
|
I use Objects that include others with the deep option.
included the configuration in my Domain Objects marshalling = { .. } configuration.
moreover i added the following to my controller setup() (from the unit test case in the project)
and initialize the test before i call the action in the controller
private def initialize(){
grailsApplication.mainContext.convertersConfigurationInitializer.initialize(grailsApplication)
grailsApplication.mainContext.extendedConvertersConfigurationInitializer.initialize()
}
After adding this the objects get marshalled as json in a correct way.
I use the serializer feature to serialize enums to their names instead of the enum object to have a nice json - when i try to verify the enum in a unit test it is working in the root object but not in the objects included with deep, on those objects the unconverted enum value is returned. When i use the same object in a real controller - the serializer works.
dont know if its a bug or if i left something out in the config - cant find any clues on how to unit test a controller the proper way.
The text was updated successfully, but these errors were encountered: