Many articles and books have already been written about unit testing patterns and anti-patterns. I want to add one more recommendation which, I believe, can help us make our tests, and our production code, more object-oriented. Here it is: a test method must contain nothing but a single assert.
[image error]Bullet (1996) by Julien Temple
Look at this test method from RandomStreamTest from OpenJDK 8, created by Brian Goetz:
@Test public void testIntStream() { final long seed = System.currentTimeMilli...
Published on May 16, 2017 17:00