assertEquals("^A.*", regExFacet.validation());
assertEquals(false, regExFacet.caseSensitive());
}
public void testRegExAnnotationPickedUpOnProperty() {
final RegExFacetFacetOnPropertyAnnotationFactory facetFactory = new RegExFacetFacetOnPropertyAnnotationFactory();
class Customer {
@SuppressWarnings("unused")
@RegEx(validation = "^A.*", caseSensitive = false)
public String getFirstName() {
return null;
}
}
final Method method = findMethod(Customer.class, "getFirstName");
facetFactory.process(new ProcessMethodContext(Customer.class, null, null, method, methodRemover, facetedMethod));
final Facet facet = facetedMethod.getFacet(RegExFacet.class);
assertNotNull(facet);
assertTrue(facet instanceof RegExFacetOnPropertyAnnotation);
final RegExFacetOnPropertyAnnotation regExFacet = (RegExFacetOnPropertyAnnotation) facet;