Skip to content

Commit c872c42

Browse files
committed
update exception thrown
1 parent 9c69dd4 commit c872c42

File tree

1 file changed

+4
-8
lines changed
  • instrumentation/dropwizard/dropwizard-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/dropwizard

1 file changed

+4
-8
lines changed

instrumentation/dropwizard/dropwizard-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/dropwizard/DropwizardAsyncTest.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ protected void configure(HttpServerTestOptions options) {
4949
super.configure(options);
5050
// server spans are ended inside the JAX-RS controller spans
5151
options.setVerifyServerSpanEndTime(false);
52+
options.setExpectedException(new IllegalStateException(EXCEPTION.getBody()));
5253
}
5354

5455
public static class AsyncTestApp extends Application<Configuration> {
@@ -127,19 +128,14 @@ public void error(@Suspended AsyncResponse asyncResponse) {
127128
@Path("exception")
128129
public void exception(@Suspended AsyncResponse asyncResponse) {
129130
executor.execute(
130-
() -> {
131-
try {
131+
() ->
132132
controller(
133133
EXCEPTION,
134134
() -> {
135-
Exception ex = new Exception(EXCEPTION.getBody());
135+
IllegalStateException ex = new IllegalStateException(EXCEPTION.getBody());
136136
asyncResponse.resume(ex);
137137
throw ex;
138-
});
139-
} catch (Exception e) {
140-
throw new RuntimeException(e);
141-
}
142-
});
138+
}));
143139
}
144140

145141
@GET

0 commit comments

Comments
 (0)