public void shouldReturnCorrectValidationMessage() {
Mockery mockery = new Mockery();
final MessageProducer messageProducer = mockery.mock(MessageProducer.class);
LengthValidator lengthValidator = new LengthValidator(messageProducer, 2);
String message = "O tamanho da entrada é inválido.";
final ValidationMessage validationMessage = new SimpleValidationMessage(message);
mockery.checking(new Expectations() {
{
one(messageProducer).getMessage(with(equal(new LengthError(2))));
will(returnValue(validationMessage));
}