Fix grails latest dep test (#2857)

This commit is contained in:
Trask Stalnaker 2021-04-23 11:20:36 -07:00 committed by GitHub
parent bd02b0ce76
commit c46221e506
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 1 deletions

View File

@ -16,4 +16,9 @@ class ErrorController implements Controller {
def index() {
render ERROR.body
}
@Action
def notFound() {
response.sendError(404, "Not Found")
}
}

View File

@ -101,6 +101,11 @@ class GrailsTest extends HttpServerTest<ConfigurableApplicationContext> implemen
endpoint == ERROR || endpoint == EXCEPTION || endpoint == NOT_FOUND
}
@Override
int getErrorPageSpansCount(ServerEndpoint endpoint) {
endpoint == NOT_FOUND ? 2 : 1
}
@Override
boolean testPathParam() {
true
@ -109,11 +114,19 @@ class GrailsTest extends HttpServerTest<ConfigurableApplicationContext> implemen
@Override
void errorPageSpans(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint) {
trace.span(index) {
name endpoint == NOT_FOUND ? "BasicErrorController.error" : "ErrorController.index"
name endpoint == NOT_FOUND ? "ErrorController.notFound" : "ErrorController.index"
kind INTERNAL
attributes {
}
}
if (endpoint == NOT_FOUND) {
trace.span(index + 1) {
name ~/\.sendError$/
kind INTERNAL
attributes {
}
}
}
}
@Override

View File

@ -16,5 +16,6 @@ class UrlMappings {
"/path/$id/param"(controller: 'test', action: 'path')
"500"(controller: 'error')
"404"(controller: 'error', action: 'notFound')
}
}