PrintWriter stackTrace = new PrintWriter(new StringWriter()); e.printStackTrace(stackTrace); errors.reject(this.errorCode, new Object[] { e, e.getMessage(), stackTrace.toString() }, "A Spring Integration handler raised an exception while handling an HTTP request. " + "The exception is of type " + e.getClass() + " and it has a message: (" +
public void testAddAllErrors() { MapBindingResult result = new MapBindingResult(new HashMap<>(), "object"); result.reject("bar", new Object[] { "boop" }, null); result.rejectValue("field", "bar", new Object[] { "boop" }, null); errors.addAllErrors(result); Message msg = context.getAllMessages()[0]; assertEquals(null, msg.getSource()); assertEquals("boop", msg.getText()); assertEquals(Severity.ERROR, msg.getSeverity()); msg = context.getAllMessages()[1]; assertEquals("field", msg.getSource()); assertEquals("boop", msg.getText()); assertEquals(Severity.ERROR, msg.getSeverity()); }
PrintWriter stackTrace = new PrintWriter(new StringWriter()); e.printStackTrace(stackTrace); errors.reject(this.errorCode, new Object[] { e, e.getMessage(), stackTrace.toString() }, "A Spring Integration handler raised an exception while handling an HTTP request. " + "The exception is of type " + e.getClass() + " and it has a message: (" +