m.put("subject", new String[] {"123456789"});
m.put("message", new String[] {"Hi there"});
m.put("sender", new String[] {"foo@example.com"});
m.put("ccMyself", new String[] {"true"});
m.put("value", new String[] {"1234"});
Form f = injector.getInstance(ContactForm.class).bind(m);
assertTrue(f.isValid());
m = new HashMap<String, String[]>();
m.put("subject", new String[] {"123456789012345"});
m.put("message", new String[] {"Hi there"});
m.put("sender", new String[] {"foo@example.com"});
m.put("ccMyself", new String[] {"true"});
m.put("value", new String[] {"1234"});
f = injector.getInstance(ContactForm.class).bind(m);
assertFalse(f.isValid());
Map errors = f.getErrors();
assertTrue(errors.containsKey("subject"));
}