File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
grails-gsp/plugin/src/test/groovy/org/grails/web/mapping Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ package org.grails.web.mapping
2020
2121import grails.artefact.Artefact
2222import grails.testing.web.UrlMappingsUnitTest
23+ import org.grails.core.artefact.UrlMappingsArtefactHandler
2324import spock.lang.Specification
2425
2526/**
@@ -29,6 +30,22 @@ import spock.lang.Specification
2930 */
3031class RestfulReverseUrlRenderingTests extends Specification implements UrlMappingsUnitTest<RestfulReverseUrlMappings > {
3132
33+ def setup () {
34+ // Clear any existing URL mappings artefacts to prevent pollution from parallel test execution
35+ clearUrlMappingsArtefacts()
36+ }
37+
38+ def cleanup () {
39+ // Clear URL mappings artefacts added by this test to prevent pollution of other tests
40+ clearUrlMappingsArtefacts()
41+ }
42+
43+ private void clearUrlMappingsArtefacts () {
44+ // Access the protected artefactInfo map and remove URL mappings to ensure test isolation
45+ if (grailsApplication instanceof grails.core.DefaultGrailsApplication ) {
46+ grailsApplication. @artefactInfo. remove(UrlMappingsArtefactHandler . TYPE )
47+ }
48+ }
3249
3350 def testLinkTagRendering () {
3451 when :
You can’t perform that action at this time.
0 commit comments