I don’t know if you managed to figure out what I’m trying to do only from the name, so I’ll try to explain using an example
Suppose I created my own @VerifySomething annotation
And I created a test class for this annotation to make sure it works.
Now let's assume that I have a class SomeClass with a field something with annotation @VerifySomething
class SomeClass { @VerifySomething String something; }
So far it’s so good, but now I want to create a test class for my SomeClass , however I don’t see the point of checking all test cases of anything, as I already checked that @VerifySomething works as it should in a class that checks this annotation, however, I need to make sure that something in the field really has the @VerifySomething annotation without copying pasting all of these test cases.
So my question is, is there a way to check if any field has one or more required annotations without writing test cases, which I already wrote in the annotation test class to make sure that it works as it should.
java hibernate-validator
Dave
source share