Fix grails latest dep test
MODIFY
instrumentation/grails-3.0/javaagent/src/test/groovy/test/ErrorController.groovy
instrumentation/grails-3.0/javaagent/src/test/groovy/test/ErrorController.groovy
@@ -16,4 +16,9 @@ class ErrorController implements Controller {
def index() {
render ERROR.body
}
+
+ @Action
+ def notFound() {
+ response.sendError(404, "Not Found")
+ }
}

MODIFY
instrumentation/grails-3.0/javaagent/src/test/groovy/test/GrailsTest.groovy
instrumentation/grails-3.0/javaagent/src/test/groovy/test/GrailsTest.groovy
@@ -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,12 +114,20 @@ 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
void responseSpan(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint) {

MODIFY
instrumentation/grails-3.0/javaagent/src/test/groovy/test/UrlMappings.groovy
instrumentation/grails-3.0/javaagent/src/test/groovy/test/UrlMappings.groovy
@@ -16,5 +16,6 @@ class UrlMappings {
"/path/$id/param"(controller: 'test', action: 'path')
"500"(controller: 'error')
+ "404"(controller: 'error', action: 'notFound')
}
}

Fix grails latest dep test (#2857)