Rakesh Sharma
Rakesh Sharma

Reputation: 309

Javax Annotation Validation JUnit without Hibernate validator

I have a jax-rs project that uses javax annotations (@NotNull, @Pattern etc.). I want to add unit tests for validating these annotations, but unfortunately cannot use the hibernate-validator (company maven repo does not have it) as suggested in this answer. Is there any other way to validate the annotations using unit tests ?

Upvotes: 1

Views: 667

Answers (1)

Rakesh Sharma
Rakesh Sharma

Reputation: 309

Apache's Bval provides a validator implementation that can serve as an alternative to hibernate-validator. Here's an example for getting started on using Bval.

Upvotes: 2

Related Questions