@Override
    public JFieldVar apply(String nodeName, JsonNode node, JsonNode parent, JFieldVar field, Schema currentSchema) {

        if (ruleFactory.getGenerationConfig().isIncludeJsr303Annotations()
            && node.has("integerDigits") && node.has("fractionalDigits")
            && isApplicableType(field)) {

            final Class<? extends Annotation> digitsClass
                    = ruleFactory.getGenerationConfig().isUseJakartaValidation()
                    ? Digits.class
                    : javax.validation.constraints.Digits.class;
            JAnnotationUse annotation = field.annotate(digitsClass);

            annotation.param("integer", node.get("integerDigits").asInt());
            annotation.param("fraction", node.get("fractionalDigits").asInt());
        }

        return field;
    }
@Test
    public void testHasIntegerAndFractionalDigits() {
        when(config.isIncludeJsr303Annotations()).thenReturn(true);
        final int intValue = new Random().nextInt();
        final int fractionalValue = new Random().nextInt();

        when(subNodeInteger.asInt()).thenReturn(intValue);
        when(subNodeFractional.asInt()).thenReturn(fractionalValue);
        when(node.get("integerDigits")).thenReturn(subNodeInteger);
        when(node.get("fractionalDigits")).thenReturn(subNodeFractional);
        when(fieldVar.annotate(digitsClass)).thenReturn(annotation);
        when(node.has("integerDigits")).thenReturn(true);
        when(node.has("fractionalDigits")).thenReturn(true);
        when(fieldVar.type().boxify().fullName()).thenReturn(fieldClass.getTypeName());

        JFieldVar result = rule.apply("node", node, null, fieldVar, null);
        assertSame(fieldVar, result);

        verify(fieldVar, times(isApplicable ? 1 : 0)).annotate(digitsClass);
        verify(annotation, times(isApplicable ? 1 : 0)).param("integer", intValue);
        verify(annotation, times(isApplicable ? 1 : 0)).param("fraction", fractionalValue);
    }