field.clean(new String[]{""}, errors);
assertTrue(errors.isEmpty());
}
public void testInvalid() throws Exception {
Field field = new BooleanField(injector.getInstance(WidgetFactory.class));
field.setName("fieldName");
Map<String, String> errors = new HashMap<String, String>();
Boolean value = (Boolean)field.clean(new String []{"qwert"}, errors);
assertFalse(errors.isEmpty());
assertTrue(errors.containsKey("fieldName"));
assertEquals("Unknown value 'qwert'", errors.get("fieldName"));
}