Skip to content

Commit 0532f0c

Browse files
committed
Run integration tests on a random port by default. Fixes #9970
1 parent 3733ee7 commit 0532f0c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

grails-bom/plugins.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ asset-pipeline=3.2.1
1010
asset-pipeline-grails=2.8.2
1111
scaffolding=3.2.1
1212
fields=2.1.2
13-
geb=1.0.1
13+
geb=1.0.2
1414
views-json=1.0.12
1515
views-markup=1.0.12

grails-plugin-testing/src/main/groovy/org/grails/compiler/injection/test/IntegrationTestMixinTransformation.groovy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ class IntegrationTestMixinTransformation implements ASTTransformation {
130130
// @WebAppConfiguration
131131
// @IntegrationTest
132132
if (ClassUtils.isPresent("javax.servlet.ServletContext", Thread.currentThread().contextClassLoader)) {
133-
classNode.addAnnotation(new AnnotationNode(WEB_INTEGRATION_TEST_CLASS_NODE))
133+
if( classNode.getAnnotations(WEB_INTEGRATION_TEST_CLASS_NODE).isEmpty() ) {
134+
def webIntegrationTestAnnotation = new AnnotationNode(WEB_INTEGRATION_TEST_CLASS_NODE)
135+
webIntegrationTestAnnotation.addMember("randomPort", new ConstantExpression(Boolean.TRUE))
136+
classNode.addAnnotation(webIntegrationTestAnnotation)
137+
}
134138
} else {
135139
classNode.addAnnotation(new AnnotationNode(INTEGRATION_TEST_CLASS_NODE))
136140
}

0 commit comments

Comments
 (0)