A developer sits at his desk, writing tests. He types:
String prediction = prognosticator.getPrediction();
assertTrue("Expected the prediction to contain
\"early spring\", but was: \"" + prediction +
"\"", prediction.contains("early
spring"));
The developer throws up his hands, falls dramatically from his chair to the floor, and wails, “Why must I type so much and create lines so long to get meaningful assertion failure messages?”
Do
you suffer from having to type too much when creating test assertions? Do long
and repetitive test assertions confuse you and cause your editor to grow
unsightly horizontal scroll bars? You need to learn about fluent test assertion
libraries! At an EJUG talk! Don’t miss discovering the latest stars: AssertJ
and Truth; with a special appearance by Hamcrest. All this for just one easy
payment of a lunch hour!
Presenter:
Warren Blanchet
Warren is a
software developer living and working in the Capital region. He has been
working in Java since the year 2000, and still enjoys it. Warren has a website:
http://www.wskb.ca/