Constructor<OrderService> constructor = OrderService.class.getConstructor(
String.class,
Item.class,
byte.class
);
OrderService returnValue = new OrderService( "" );
Set<ConstraintViolation<OrderService>> violations = executableValidator.validateConstructorReturnValue(
constructor,
returnValue,
OrderServiceSequence.class
);
//Only the constraints of the Basic group should fail
assertCorrectConstraintTypes( violations, ValidOrderService.class, Size.class );
assertCorrectPathNodeNames(
violations,
names( className, TestUtil.RETURN_VALUE_NODE_NAME ),
names( className, TestUtil.RETURN_VALUE_NODE_NAME, "name" )
);
assertCorrectPathNodeKinds(
violations,
kinds( ElementKind.CONSTRUCTOR, ElementKind.RETURN_VALUE ),
kinds( ElementKind.CONSTRUCTOR, ElementKind.RETURN_VALUE, ElementKind.PROPERTY )
);
returnValue = new OrderService( "valid order service" );
violations = executableValidator.validateConstructorReturnValue(
constructor,
returnValue,
OrderServiceSequence.class