Constructor<OrderService> constructor = OrderService.class.getConstructor(
String.class,
Item.class,
byte.class
);
Object[] parameterValues = new Object[] { null, new Item( "" ), (byte) 0 };
Set<ConstraintViolation<OrderService>> violations = executableValidator.validateConstructorParameters(
constructor,
parameterValues,
OrderServiceSequence.class
);
//Only the constraints of the Basic group should fail
assertCorrectConstraintTypes( violations, Size.class, NotNull.class );
assertCorrectPathNodeNames(
violations,
names( className, "arg0" ),
names( className, "arg1", "name" )
);
assertCorrectPathNodeKinds(
violations,
kinds( ElementKind.CONSTRUCTOR, ElementKind.PARAMETER ),
kinds( ElementKind.CONSTRUCTOR, ElementKind.PARAMETER, ElementKind.PROPERTY )
);
parameterValues = new Object[] { "Bob", new Item( "BV Specification" ), (byte) 0 };
violations = executableValidator.validateConstructorParameters(
constructor,
parameterValues,
OrderServiceSequence.class