@Test @InSequence(4) public void removeTimerFromRegistry() { assertThat("Timer is not registered correctly", registry.getTimers(), hasKey(TIMER_NAME)); Timer timer = registry.getTimers().get(TIMER_NAME); registry.remove(TIMER_NAME); try { bean.timedMethod(); } catch (RuntimeException cause) { assertThat(cause, is(instanceOf(IllegalStateException.class))); assertThat(cause.getMessage(), is(equalTo("No timer with name [" + TIMER_NAME + "] found in registry [" + registry + "]"))); assertThat("Timer count is incorrect", timer.getCount(), is(equalTo(TIMER_COUNT.get()))); return; } fail("No exception has been re-thrown!"); }
@Timed(name = "timedMethod") public void timedMethod() { }
TimedMethodBean { @Timed(name = "timedMethod") public void timedMethod() { } }
TimedMethodBean { @Timed(name = "timedMethod") public void timedMethod() { }  }
TimedMethodBean { @Timed(name = "timedMethod") public void timedMethod() { }  @Timed(name = "timedMethod") void timedMethod(); void selfInvocationTimedMethod(); }
TimedMethodBean { @Timed(name = "timedMethod") public void timedMethod() { }  @Timed(name = "timedMethod") void timedMethod(); void selfInvocationTimedMethod();  }