BindingResult br = new TestBindingResult(Collections.<FieldError> emptyList());
ExtDirectFormPostResult result = new ExtDirectFormPostResult(br, false);
assertThat(result.getResult()).hasSize(1).contains(
MapEntry.entry("success", Boolean.FALSE));
br = new TestBindingResult(Arrays.asList(new FieldError("testobject", "field1",
"message"), new FieldError("testobject", "field2", "second message")));
result = new ExtDirectFormPostResult(br, true);
assertThat(result.getResult()).hasSize(2).contains(
MapEntry.entry("success", Boolean.TRUE));
Map<String, List<String>> errors = (Map<String, List<String>>) result.getResult()
.get("errors");