From 7342e5eddc420709feaaeb1798639a800b89ea52 Mon Sep 17 00:00:00 2001 From: "HCG\\Patrik.Mihalcin" Date: Sat, 2 Jun 2018 16:14:33 +0200 Subject: [PATCH 1/2] Add iml extension to .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b7ccf2c..f2ca890 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ gradle-app.setting # Cache of project .gradletasknamecache -.idea/ \ No newline at end of file +.idea/ +*.iml \ No newline at end of file From 0f465b6ebdaf64027f73374a5add653229364055 Mon Sep 17 00:00:00 2001 From: "HCG\\Patrik.Mihalcin" Date: Sat, 2 Jun 2018 16:25:34 +0200 Subject: [PATCH 2/2] Add @Override --- .../TestcontainersMethodInterceptor.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/com/groovycoder/spockdockerextension/TestcontainersMethodInterceptor.groovy b/src/main/groovy/com/groovycoder/spockdockerextension/TestcontainersMethodInterceptor.groovy index 2944418..bb6bf4c 100644 --- a/src/main/groovy/com/groovycoder/spockdockerextension/TestcontainersMethodInterceptor.groovy +++ b/src/main/groovy/com/groovycoder/spockdockerextension/TestcontainersMethodInterceptor.groovy @@ -26,6 +26,7 @@ class TestcontainersMethodInterceptor extends AbstractMethodInterceptor { invocation.proceed() } + @Override void interceptCleanupSpecMethod(IMethodInvocation invocation) throws Throwable { def containers = findAllContainers(true) stopContainers(containers, invocation) @@ -74,7 +75,7 @@ class TestcontainersMethodInterceptor extends AbstractMethodInterceptor { private static void startContainers(List containers, IMethodInvocation invocation) { containers.each { FieldInfo f -> GenericContainer container = readContainerFromField(f, invocation) - if(!container.isRunning()){ + if (!container.isRunning()) { container.start() } } @@ -101,7 +102,6 @@ class TestcontainersMethodInterceptor extends AbstractMethodInterceptor { } } - private static GenericContainer readContainerFromField(FieldInfo f, IMethodInvocation invocation) { f.readValue(invocation.instance) as GenericContainer }