I'm having a JUnit test case to test a simple class. The class to be tested contains only one "sum" method that adds two numbers. To test if it is correct, I use the following method: Assert.assertEquals(2, meu_objeto.sum(1, 2));
The result appears in a JUnit tab in the eclipse, in a part called Failure Trace. The message says: junit.framework.AssertionFailedError: expected:<2> but was:<3>
Is it possible to get this message and put it inside a String variable?