Examples of BigDecimalForPropertyDerivedFromJavaxValidationDigitsFacetFactory


Examples of org.apache.isis.core.progmodel.facets.properties.javaxvaldigits.BigDecimalForPropertyDerivedFromJavaxValidationDigitsFacetFactory

import org.apache.isis.core.progmodel.facets.value.bigdecimal.BigDecimalValueFacet;

public class JavaxValidationDigitsAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {

    public void testAnnotationPickedUpOnProperty() {
        final BigDecimalForPropertyDerivedFromJavaxValidationDigitsFacetFactory facetFactory = new BigDecimalForPropertyDerivedFromJavaxValidationDigitsFacetFactory();

        class Order {
            @SuppressWarnings("unused")
            @javax.validation.constraints.Digits(integer=14, fraction=4)
            public BigDecimal getCost() {
                return null;
            }
        }
        final Method method = findMethod(Order.class, "getCost");

        facetFactory.process(new ProcessMethodContext(Order.class, null, null, method, methodRemover, facetedMethod));

        final Facet facet = facetedMethod.getFacet(BigDecimalValueFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof BigDecimalFacetForPropertyFromJavaxValidationDigitsAnnotation);
        final BigDecimalFacetForPropertyFromJavaxValidationDigitsAnnotation annotation = (BigDecimalFacetForPropertyFromJavaxValidationDigitsAnnotation) facet;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.