...

/

Test Smell: Irrelevant Details

Test Smell: Irrelevant Details

Learn how to remove irrelevant details by using the @After and @Before helper methods.

Distractions

Although we want to turn off logging when tests run, the code to do so is a distraction to understanding the essence of any test. Though we should always close streams, doing so is also a distraction.

Using @After and @Before methods

To remedy this issue, let’s move the bits of clutter to @Before and ...