Fix grails latest dep test (#2857)
This commit is contained in:
parent
bd02b0ce76
commit
c46221e506
|
@ -16,4 +16,9 @@ class ErrorController implements Controller {
|
||||||
def index() {
|
def index() {
|
||||||
render ERROR.body
|
render ERROR.body
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Action
|
||||||
|
def notFound() {
|
||||||
|
response.sendError(404, "Not Found")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,11 @@ class GrailsTest extends HttpServerTest<ConfigurableApplicationContext> implemen
|
||||||
endpoint == ERROR || endpoint == EXCEPTION || endpoint == NOT_FOUND
|
endpoint == ERROR || endpoint == EXCEPTION || endpoint == NOT_FOUND
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
int getErrorPageSpansCount(ServerEndpoint endpoint) {
|
||||||
|
endpoint == NOT_FOUND ? 2 : 1
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
boolean testPathParam() {
|
boolean testPathParam() {
|
||||||
true
|
true
|
||||||
|
@ -109,11 +114,19 @@ class GrailsTest extends HttpServerTest<ConfigurableApplicationContext> implemen
|
||||||
@Override
|
@Override
|
||||||
void errorPageSpans(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint) {
|
void errorPageSpans(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint) {
|
||||||
trace.span(index) {
|
trace.span(index) {
|
||||||
name endpoint == NOT_FOUND ? "BasicErrorController.error" : "ErrorController.index"
|
name endpoint == NOT_FOUND ? "ErrorController.notFound" : "ErrorController.index"
|
||||||
kind INTERNAL
|
kind INTERNAL
|
||||||
attributes {
|
attributes {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (endpoint == NOT_FOUND) {
|
||||||
|
trace.span(index + 1) {
|
||||||
|
name ~/\.sendError$/
|
||||||
|
kind INTERNAL
|
||||||
|
attributes {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -16,5 +16,6 @@ class UrlMappings {
|
||||||
"/path/$id/param"(controller: 'test', action: 'path')
|
"/path/$id/param"(controller: 'test', action: 'path')
|
||||||
|
|
||||||
"500"(controller: 'error')
|
"500"(controller: 'error')
|
||||||
|
"404"(controller: 'error', action: 'notFound')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue