@Test @InSequence(3) public void removeMeterFromRegistry() { assertThat("Meter is not registered correctly", registry.getMeters(), hasKey(METER_NAME)); Meter meter = registry.getMeters().get(METER_NAME); registry.remove(METER_NAME); try { bean.meteredMethod(); } catch (RuntimeException cause) { assertThat(cause, is(instanceOf(IllegalStateException.class))); assertThat(cause.getMessage(), is(equalTo("No meter with name [" + METER_NAME + "] found in registry [" + registry + "]"))); assertThat("Meter count is incorrect", meter.getCount(), is(equalTo(METER_COUNT.get()))); return; } fail("No exception has been re-thrown!"); }
@Metered(name = "meteredMethod") public void meteredMethod() { }
MeteredMethodBean { @Metered(name = "meteredMethod") public void meteredMethod() { } }
MeteredMethodBean { @Metered(name = "meteredMethod") public void meteredMethod() { }  }
MeteredMethodBean { @Metered(name = "meteredMethod") public void meteredMethod() { }  @Metered(name = "meteredMethod") void meteredMethod(); }
MeteredMethodBean { @Metered(name = "meteredMethod") public void meteredMethod() { }  @Metered(name = "meteredMethod") void meteredMethod();  }