I'm trying to ensure that a parameter can't be null by adding an assert statement at the top of the method.
When unit testing, I'm trying to declare that the AssertError is expected, but it still gets recognized as a failed test even though it's behaviour is correct (AssertError is getting thrown).
class ExampleTest {
@Test(expected=AssertError.class)
public void testAssertFails() {
assert 0 == 1;
}
}