import org.apache.isis.core.progmodel.facets.properties.typicallen.annotation.TypicalLengthFacetAnnotationOnProperty;
public class TypicalLengthAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
public void testTypicalLengthAnnotationPickedUpOnProperty() {
final TypicalLengthAnnotationOnPropertyFacetFactory facetFactory = new TypicalLengthAnnotationOnPropertyFacetFactory();
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 TypicalLengthFacetAnnotationOnProperty);
final TypicalLengthFacetAnnotationOnProperty typicalLengthFacetAnnotation = (TypicalLengthFacetAnnotationOnProperty) facet;