StringWriter result = runMethod.getOutput();
String expected = "<3>textValue</3>"
assertTrue("Should have contained the required result", result.toString().contains(expected));
Why does Junit return an error here ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I just tried this and it works fine.
It gives the following error if the string does not match.
java.lang.AssertionError: Should have contained the required result