@SuppressWarnings("unchecked")
@Test
public void constraint_value_from_message_catalog() throws Exception
{
ValidationMessagesSource messagesSource = mockValidationMessagesSource();
Validator validator = mockValidator();
TypeCoercer coercer = mockTypeCoercer();
FieldComponent field = newFieldComponent();
Messages messages = mockMessages();
MessageFormatter formatter = mockMessageFormatter();
Object inputValue = new Object();
ComponentResources resources = mockComponentResources();
Messages containerMessages = mockMessages();
Map<String, Validator> map = singletonMap("minlength", validator);
train_getConstraintType(validator, Integer.class);
train_getComponentResources(field, resources);
train_getId(resources, "fred");
train_contains(containerMessages, "fred-minlength", true);
train_get(containerMessages, "fred-minlength", "5");
train_coerce(coercer, "5", Integer.class, 5);
train_getContainerMessages(resources, containerMessages);
train_contains(containerMessages, "fred-minlength-message", false);
train_getLocale(resources, Locale.FRENCH);
train_getValidationMessages(messagesSource, Locale.FRENCH, messages);
train_getMessageKey(validator, "key");
train_getMessageFormatter(messages, "key", formatter);
train_invokeIfBlank(validator, false);
train_getValueType(validator, Object.class);
validator.validate(field, 5, formatter, inputValue);
replay();
FieldValidatorSource source = new FieldValidatorSourceImpl(messagesSource, coercer, null, map);