As2Disposition { @Override public String toString() { StringBuilder sb = new StringBuilder(actionMode.getTextValue() + "/" + sendingMode.getTextValue() + "; " + dispositionType.getTextValue()); if (dispositionModifier != null) { sb.append('/'); sb.append(dispositionModifier.toString()); } return sb.toString(); } As2Disposition(ActionMode actionMode, SendingMode sendingMode, DispositionType dispositionType);  As2Disposition(ActionMode actionMode, SendingMode sendingMode, DispositionType dispositionType, DispositionModifier dispositionModifier); static As2Disposition processed(); static As2Disposition processedWithWarning(String warningMessage); static As2Disposition processedWithError(String errorMessage); static As2Disposition failed(String message); @Override String toString(); static As2Disposition valueOf(String s); static Pattern pattern; }
@Test public void testToString() throws Exception { String s = As2Disposition.processed().toString(); assertEquals(s, "automatic-action/MDN-sent-automatically; processed"); s = As2Disposition.failed("uhada").toString(); assertEquals(s.toLowerCase(), "automatic-action/mdn-sent-automatically; failed/failure: uhada"); s = As2Disposition.processedWithError("Ouch!").toString(); assertEquals(s.toLowerCase(), "automatic-action/mdn-sent-automatically; processed/error: ouch!"); }