When I tried to test if the annotation was responding with the following code, it failed with java.lang.NoClassDefFoundError: org / jsoup / safety / Whitelist
when calling the validate
method.
Set<ConstraintViolation<Tested class>> set =
Validation.buildDefaultValidatorFactory().getValidator().validate(Instance to be tested);
The class under test was using the annotations defined in ʻorg.hibernate.validator.constraintsand the internal
jsoup` was not properly placed.
I added the following to Maven and it works fine.
pom.xml
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.11.3</version>
</dependency>
Recommended Posts