-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Class level validation is ignored in the junit test executio
PostPosted: Wed May 07, 2014 4:36 pm 
Newbie

Joined: Wed May 07, 2014 1:52 pm
Posts: 1
Hi everyone.

I have a Entity Class which has annotation into fields and class level, this class has a DAO implementation.

By integrity, I built a custom validation annotation to class level and its validator.

The problem is when the junit test is run, this validated the field annotations constraints, like @NotNull or @Min, while the annotation put to the class is ignored it

The validation does nothing.

BTW. I am using springframework.


Top
 Profile  
 
 Post subject: Re: Class level validation is ignored in the junit test executio
PostPosted: Fri May 09, 2014 5:38 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Hi,

Some more context would be helpful to answer your question.

How exactly are you triggering validation? Do you do it yourself (via the javax.validation.Validator API) or is it done automatically using specific lifecycle hooks, e.g. upon persisting the entities or when binding user input from a frontend to the model? I'm asking because in many integrations of UI techs and Bean Validation, class-level constraints are not applied by default.

Also how do your entity and custom constraint look like?

--Gunnar

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.