use of jakarta.validation.metadata.MethodDescriptor in project beanvalidation-tck by eclipse-ee4j.
the class ExecutableDescriptorTest method testGetParameterDescriptorsForMethod.
@Test
@SpecAssertion(section = Sections.CONSTRAINTMETADATA_EXECUTABLEDESCRIPTOR, id = "b")
public void testGetParameterDescriptorsForMethod() {
MethodDescriptor descriptor = Executables.parameterConstrainedMethod();
assertEquals(descriptor.getParameterDescriptors().size(), 2, "Size of parameter descriptor list doesn't match method parameter count");
}
use of jakarta.validation.metadata.MethodDescriptor in project beanvalidation-tck by eclipse-ee4j.
the class ExecutableDescriptorTest method testAreParametersConstrainedForCascadedMethod.
@Test
@SpecAssertion(section = Sections.CONSTRAINTMETADATA_EXECUTABLEDESCRIPTOR, id = "e")
public void testAreParametersConstrainedForCascadedMethod() {
MethodDescriptor descriptor = Executables.cascadedParameterMethod();
assertTrue(descriptor.hasConstrainedParameters(), "Should be constrained on parameters");
}
use of jakarta.validation.metadata.MethodDescriptor in project beanvalidation-tck by eclipse-ee4j.
the class ExecutableDescriptorTest method testGetElementClassForVoidMethod.
@Test
@SpecAssertion(section = Sections.CONSTRAINTMETADATA_ELEMENTDESCRIPTOR, id = "a")
public void testGetElementClassForVoidMethod() {
MethodDescriptor descriptor = Executables.parameterConstrainedMethod();
assertEquals(descriptor.getElementClass(), void.class);
}
use of jakarta.validation.metadata.MethodDescriptor in project beanvalidation-tck by eclipse-ee4j.
the class ExecutableDescriptorTest method testIsReturnValueConstrainedForNotConstrainedMethod.
@Test
@SpecAssertion(section = Sections.CONSTRAINTMETADATA_EXECUTABLEDESCRIPTOR, id = "f")
public void testIsReturnValueConstrainedForNotConstrainedMethod() {
MethodDescriptor descriptor = Executables.cascadedParameterMethod();
assertFalse(descriptor.hasConstrainedReturnValue(), "Should not be constrained on return value");
}
use of jakarta.validation.metadata.MethodDescriptor in project beanvalidation-tck by eclipse-ee4j.
the class ExecutableDescriptorTest method testFindConstraintsForMethodDefinedOnSuperTypeLookingAt.
@Test
@SpecAssertion(section = Sections.CONSTRAINTMETADATA_ELEMENTDESCRIPTOR, id = "d")
@SpecAssertion(section = Sections.CONSTRAINTMETADATA_ELEMENTDESCRIPTOR, id = "g")
@SpecAssertion(section = Sections.CONSTRAINTMETADATA_EXECUTABLEDESCRIPTOR, id = "g")
public void testFindConstraintsForMethodDefinedOnSuperTypeLookingAt() {
MethodDescriptor crossParameterConstrainedDescriptor = Executables.crossParameterConstrainedMethodFromSuperType();
assertEquals(crossParameterConstrainedDescriptor.findConstraints().lookingAt(Scope.LOCAL_ELEMENT).getConstraintDescriptors().size(), 0, "Should have no local constraints");
assertTrue(crossParameterConstrainedDescriptor.findConstraints().lookingAt(Scope.HIERARCHY).getConstraintDescriptors().isEmpty(), "Should have no hierarchy constraint");
}
Aggregations