Jamon extends OpenMonBase<Monitor> { @Override public void exception(JoinPoint jp, Throwable throwable) { put(throwable); trackException(jp, throwable); }  @Override Monitor start(JoinPoint.StaticPart jp); @Override void stop(Monitor mon); @Override void stop(Monitor mon, Throwable throwable); @Override void exception(JoinPoint jp, Throwable throwable);  }
@Test public void testException() throws Exception { assertThat(MonitorFactory.exists(SharedConstants.EXCEPTION_LABEL, "Exception")).describedAs("The exception monitor should not exist yet").isFalse(); openMon.exception(jp, SharedConstants.EXCEPTION); assertThat(MonitorFactory.getMonitor(SharedConstants.EXCEPTION_LABEL, "Exception").getHits()).describedAs("One exception should have been thrown").isEqualTo(1); assertThat(MonitorFactory.getMonitor(OpenMon.EXCEPTION_LABEL, "Exception").getHits()).describedAs("One exception should have been thrown").isEqualTo(1); Map<Throwable, AutomonExpirable> map = openMon.getExceptionsMap(); assertThat(map.get(SharedConstants.EXCEPTION).getThrowable()).describedAs("Throwable should have been set").isEqualTo(SharedConstants.EXCEPTION); assertThat(map.get(SharedConstants.EXCEPTION).getArgNamesAndValues()).describedAs("Arg names and values should have been set").isNotNull(); assertThat(map.size()).isEqualTo(1); map.forEach((throwable,automonExpirable)->assertThat(automonExpirable.getJamonDetails().get()).isInstanceOf(String.class)); }