Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
JUnit tests should include at least one assertion. This makes the tests more robust, and using assert with messages provide the developer a clearer idea of what the test does.
<pre>
public class Foo extends TestCase {
  public void testSomething() {
    Bar b = findBar();
    b.work();
    // violation, we could use assertNotNull("bar not found", b);
  }
}
</pre>
New to GrepCode? Check out our FAQ X