When I use JMock with JUnit ExpectedException
the tests seem to pass even if the exception is not thrown. For example, the test below fails, as it should. But if I uncomment the two commented lines, it passes. Am I doing something wrong? Is there an incompatibility between these two components?
//@RunWith(JMock.class)
public class JUnitJMockTest {
@Rule
public ExpectedException exception = ExpectedException.none();
//Mockery context = new JUnit4Mockery();
@Test
public void test() {
exception.expect(NullPointerException.class);
}
}