use of jakarta.ws.rs.ProcessingException in project metrics by dropwizard.
the class SingletonMetricsJerseyTest method exceptionMeteredMethodsAreExceptionMetered.
@Test
public void exceptionMeteredMethodsAreExceptionMetered() {
final Meter meter = registry.meter(name(InstrumentedResource.class, "exceptionMetered", "exceptions"));
assertThat(target("exception-metered").request().get(String.class)).isEqualTo("fuh");
assertThat(meter.getCount()).isZero();
try {
target("exception-metered").queryParam("splode", true).request().get(String.class);
failBecauseExceptionWasNotThrown(ProcessingException.class);
} catch (ProcessingException e) {
assertThat(e.getCause()).isInstanceOf(IOException.class);
}
assertThat(meter.getCount()).isEqualTo(1);
}
use of jakarta.ws.rs.ProcessingException in project metrics by dropwizard.
the class SingletonMetricsExceptionMeteredPerClassJerseyTest method exceptionMeteredMethodsAreExceptionMetered.
@Test
public void exceptionMeteredMethodsAreExceptionMetered() {
final Meter meter = registry.meter(name(InstrumentedResourceExceptionMeteredPerClass.class, "exceptionMetered", "exceptions"));
assertThat(target("exception-metered").request().get(String.class)).isEqualTo("fuh");
assertThat(meter.getCount()).isZero();
try {
target("exception-metered").queryParam("splode", true).request().get(String.class);
failBecauseExceptionWasNotThrown(ProcessingException.class);
} catch (ProcessingException e) {
assertThat(e.getCause()).isInstanceOf(IOException.class);
}
assertThat(meter.getCount()).isEqualTo(1);
}
use of jakarta.ws.rs.ProcessingException in project metrics by dropwizard.
the class SingletonMetricsExceptionMeteredPerClassJerseyTest method subresourcesFromLocatorsRegisterMetrics.
@Test
public void subresourcesFromLocatorsRegisterMetrics() {
final Meter meter = registry.meter(name(InstrumentedSubResourceExceptionMeteredPerClass.class, "exceptionMetered", "exceptions"));
assertThat(target("subresource/exception-metered").request().get(String.class)).isEqualTo("fuh");
assertThat(meter.getCount()).isZero();
try {
target("subresource/exception-metered").queryParam("splode", true).request().get(String.class);
failBecauseExceptionWasNotThrown(ProcessingException.class);
} catch (ProcessingException e) {
assertThat(e.getCause()).isInstanceOf(IOException.class);
}
assertThat(meter.getCount()).isEqualTo(1);
}
Aggregations