Skip to content

Commit

Permalink
update exception assert
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydeluca committed Nov 1, 2024
1 parent 6b06a82 commit e4548db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ protected void configure(HttpServerTestOptions options) {
super.configure(options);
// server spans are ended inside the JAX-RS controller spans
options.setVerifyServerSpanEndTime(false);
options.setExpectedException(new IllegalStateException(EXCEPTION.getBody()));
}

public static class AsyncTestApp extends Application<Configuration> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ protected void configure(HttpServerTestOptions options) {
options.setHasResponseSpan(endpoint -> endpoint == NOT_FOUND);
options.setTestPathParam(true);
options.setResponseCodeOnNonStandardHttpMethod(405);
options.setExpectedException(new IllegalStateException(EXCEPTION.getBody()));

options.setExpectedHttpRoute(
(endpoint, method) -> {
Expand Down Expand Up @@ -107,7 +108,8 @@ protected SpanDataAssert assertHandlerSpan(
span.hasName(testResource().getSimpleName() + "." + getEndpointName(endpoint))
.hasKind(INTERNAL);
if (EXCEPTION.equals(endpoint)) {
span.hasStatus(StatusData.error()).hasException(new Exception(EXCEPTION.getBody()));
span.hasStatus(StatusData.error())
.hasException(new IllegalStateException(EXCEPTION.getBody()));
}
return span;
}
Expand Down Expand Up @@ -192,7 +194,7 @@ public Response exception() throws Exception {
return controller(
EXCEPTION,
() -> {
throw new Exception(EXCEPTION.getBody());
throw new IllegalStateException(EXCEPTION.getBody());
});
}

Expand Down

0 comments on commit e4548db

Please sign in to comment.