@Test
public void field_is_optional()
{
Field field = mockField();
ValidationDecorator delegate = mockValidationDecorator();
ValidationTracker tracker = mockValidationTracker();
JavaScriptSupport jsSupport = mockJavaScriptSupport();
delegate.insideField(field);
train_isDisabled(field, false);
train_inError(tracker, field, false);
train_isRequired(field, false);
train_getClientId(field, "foo");
jsSupport.autofocus(FieldFocusPriority.OPTIONAL, "foo");
replay();
ValidationDecorator decorator = new AutofocusValidationDecorator(delegate, tracker, jsSupport);
decorator.insideField(field);
verify();
}