}
public void testGetMessageCodeForException() {
DefaultBindingErrorMessageProvider provider = new DefaultBindingErrorMessageProvider();
assertEquals("typeMismatch", provider.getMessageCodeForException(new TypeMismatchException(new Object(),
String.class)));
assertEquals("required", provider.getMessageCodeForException(new NullPointerException()));
assertEquals("typeMismatch", provider.getMessageCodeForException(new InvalidFormatException("", "")));
assertEquals("typeMismatch", provider.getMessageCodeForException(new IllegalArgumentException()));
assertEquals("required", provider.getMessageCodeForException(new RuntimeException(new NullPointerException())));