import org.apache.isis.core.progmodel.facets.properties.typicallen.annotation.TypicalLengthFacetOnPropertyAnnotation;
public class TypicalLengthAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
public void testTypicalLengthAnnotationPickedUpOnProperty() {
final TypicalLengthOnPropertyFacetFactory facetFactory = new TypicalLengthOnPropertyFacetFactory();
class Customer {
@SuppressWarnings("unused")
@TypicalLength(30)
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(TypicalLengthFacet.class);
assertNotNull(facet);
assertTrue(facet instanceof TypicalLengthFacetOnPropertyAnnotation);
final TypicalLengthFacetOnPropertyAnnotation typicalLengthFacetAnnotation = (TypicalLengthFacetOnPropertyAnnotation) facet;