Permalink
Browse files

Run integration tests on a random port by default. Fixes #9970

  • Loading branch information...
graemerocher committed Jun 27, 2016
1 parent 3733ee7 commit 0532f0cef10990c651c01300007458cba9efff86
@@ -10,6 +10,6 @@ asset-pipeline=3.2.1
asset-pipeline-grails=2.8.2
scaffolding=3.2.1
fields=2.1.2
geb=1.0.1
geb=1.0.2
views-json=1.0.12
views-markup=1.0.12
@@ -130,7 +130,11 @@ class IntegrationTestMixinTransformation implements ASTTransformation {
// @WebAppConfiguration
// @IntegrationTest
if (ClassUtils.isPresent("javax.servlet.ServletContext", Thread.currentThread().contextClassLoader)) {
classNode.addAnnotation(new AnnotationNode(WEB_INTEGRATION_TEST_CLASS_NODE))
if( classNode.getAnnotations(WEB_INTEGRATION_TEST_CLASS_NODE).isEmpty() ) {
def webIntegrationTestAnnotation = new AnnotationNode(WEB_INTEGRATION_TEST_CLASS_NODE)
webIntegrationTestAnnotation.addMember("randomPort", new ConstantExpression(Boolean.TRUE))
classNode.addAnnotation(webIntegrationTestAnnotation)
}
} else {
classNode.addAnnotation(new AnnotationNode(INTEGRATION_TEST_CLASS_NODE))
}

0 comments on commit 0532f0c

Please sign in to comment.