Lasse Koskela
More books by Lasse Koskela…
“The approach shown... is a common pattern for testing exception-throwing behavior with JUnit.
― Test Driven: Practical TDD and Acceptance TDD for Java Developers
”
@Test
public void missingValueRaisesException() throws Exception {
try {
new Template("${foo}").evaluate();
fail("evaluate() should throw an exception if "
+ "a variable was left without a value!");
} catch (MissingValueException expected) {
}
}
― Test Driven: Practical TDD and Acceptance TDD for Java Developers
Is this you? Let us know. If not, help out and invite Lasse to Goodreads.


