@Test(expected = NullPointerException.class) public void testInvokingNotExistentTimer() throws Throwable { try { helper.invokeTimerFor(TestAggregator.class, "blkjhsdgfksdyufgks"); } catch (RuntimeException e) { assertThat(e.getClass().getName(), is(RuntimeException.class.getName())); throw e.getCause(); } }
@Test(expected = NullPointerException.class) public void testInvokingTimerWithNullMethodName() throws Throwable { try { helper.invokeTimerFor(TestAggregator.class, null); } catch (RuntimeException e) { assertThat(e.getClass().getName(), is(RuntimeException.class.getName())); throw e.getCause(); } }
@Test public void testInvokingSetFlagTimerOnly() { helper.invokeTimerFor(TestAggregator.class, "setFlag"); verifyResetStateCalled(0); verifySetFlagCalled(1); assertMessage(notNullValue()); assertFlag(true); }