Double value = field.clean(new String[]{"1234.5"}, errors);
assertTrue(errors.isEmpty());
}
public void testTooManyDecimalPlaces() throws Exception {
DoubleField field = injector.getInstance(DoubleField.class);
field.setDecimalPlaces(2);
field.setName("fieldName");
Map<String, String> errors = new HashMap<String, String>();
Double value = field.clean(new String[]{"1234.567"}, errors);
assertFalse(errors.isEmpty());
assertEquals(String.format(DoubleField.ERROR_MAX_DECIMAL_PLACES, 2), errors.get("fieldName"));
}