diff --git a/build.gradle b/build.gradle index 672b8535..ed4c3175 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,8 @@ buildscript { } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsVersion" - //classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.1" classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}" +// classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.15.1" } } @@ -17,8 +17,8 @@ apply plugin:"eclipse" apply plugin:"idea" apply plugin:"war" apply plugin:"org.grails.grails-web" -apply plugin:"org.grails.grails-gsp" //apply plugin:"asset-pipeline" +apply plugin:"org.grails.grails-gsp" repositories { mavenLocal() @@ -31,12 +31,12 @@ dependencies { compile "javax.mail:mail:1.4" //compile "com.stripe:stripe-java:1.32.1" compile "com.google.code.gson:gson:2.3.1" - compile "org.grails.plugins:spring-security-shiro:3.0.0" - compile "org.grails.plugins:quartz:2.0.12" + compile 'org.grails.plugins:spring-security-shiro:3.1.1' + compile "org.grails.plugins:quartz:2.0.12" //compile files("lib/easypost-java-2.1.2.jar") compile files("lib/easypost-api-client-3.4.0.jar") compile files("lib/stripe-java-4.9.0.jar") - //compile files("lib/postgresql-42.1.1.jar") + //compile files("lib/postgresql-42.1.1.jar") /*************************************************************/ compile "org.springframework.boot:spring-boot-starter-logging" @@ -44,19 +44,30 @@ dependencies { compile "org.grails:grails-core" compile "org.springframework.boot:spring-boot-starter-actuator" compile "org.springframework.boot:spring-boot-starter-tomcat" - compile "org.grails:grails-dependencies" compile "org.grails:grails-web-boot" + compile "org.grails:grails-logging" + compile "org.grails:grails-plugin-rest" + compile "org.grails:grails-plugin-databinding" + compile "org.grails:grails-plugin-i18n" + compile "org.grails:grails-plugin-services" + compile "org.grails:grails-plugin-url-mappings" + compile "org.grails:grails-plugin-interceptors" compile "org.grails.plugins:cache" + compile "org.grails.plugins:async" compile "org.grails.plugins:scaffolding" + compile "org.grails.plugins:events" compile "org.grails.plugins:hibernate5" - compile "org.hibernate:hibernate-core:5.1.3.Final" - compile "org.hibernate:hibernate-ehcache:5.1.3.Final" + compile "org.hibernate:hibernate-core:5.1.16.Final" + compile "org.grails.plugins:gsp" console "org.grails:grails-console" profile "org.grails.profiles:web" - //runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.14.1" + runtime "org.glassfish.web:el-impl:2.1.2-b03" runtime "com.h2database:h2" - testCompile "org.grails:grails-plugin-testing" + runtime "org.apache.tomcat:tomcat-jdbc" + runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.15.1" + testCompile "org.grails:grails-gorm-testing-support" testCompile "org.grails.plugins:geb" + testCompile "org.grails:grails-web-testing-support" testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1" testRuntime "net.sourceforge.htmlunit:htmlunit:2.18" } @@ -64,13 +75,14 @@ dependencies { bootRun { jvmArgs('-Dspring.output.ansi.enabled=always') addResources = true + String springProfilesActive = 'spring.profiles.active' + systemProperty springProfilesActive, System.getProperty(springProfilesActive) } //TODO:uncomment //assets { - // minifyJs = true - // minifyCss = true - // includes = ["js/*", "css/**", "bootstrap/**", "images/**"] +// minifyJs = true +// minifyCss = true //} String.metaClass.uncapitalize = { diff --git a/gradle.properties b/gradle.properties index ccb1a2ab..1365cec4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ -grailsVersion=3.2.8 -gormVersion=6.0.9.RELEASE -gradleWrapperVersion=3.4.1 +grailsVersion=3.3.9 +gormVersion=6.1.11.RELEASE +gradleWrapperVersion=3.5 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index cc2cec13..ca9ec11b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/gradlew.bat b/gradlew.bat index 8a0b282a..aec99730 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,90 +1,90 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/grails-app/conf/application.yml b/grails-app/conf/application.yml index 59477fb8..f40c473a 100644 --- a/grails-app/conf/application.yml +++ b/grails-app/conf/application.yml @@ -106,7 +106,6 @@ hibernate: queries: false use_second_level_cache: true use_query_cache: false - region.factory_class: org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory dataSource: pooled: true diff --git a/grailsw b/grailsw index c2c921c2..8d0cc123 100644 --- a/grailsw +++ b/grailsw @@ -102,6 +102,7 @@ fi if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` JAVACMD=`cygpath --unix "$JAVACMD"` + JAR_PATH=`cygpath --path --mixed "$JAR_PATH"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` diff --git a/grailsw.bat b/grailsw.bat index 14734e44..c48c3840 100644 --- a/grailsw.bat +++ b/grailsw.bat @@ -1,89 +1,89 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Grails startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRAILS_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-XX:+TieredCompilation" "-XX:TieredStopAtLevel=1" "-XX:CICompilerCount=3" - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line -set JAR_PATH=%APP_HOME%/grails-wrapper.jar - -@rem Execute Grails -"%JAVA_EXE%" -jar %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRAILS_OPTS% %JAR_PATH% %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRAILS_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRAILS_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Grails startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRAILS_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-XX:+TieredCompilation" "-XX:TieredStopAtLevel=1" "-XX:CICompilerCount=3" + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line +set JAR_PATH=%APP_HOME%/grails-wrapper.jar + +@rem Execute Grails +"%JAVA_EXE%" -jar %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRAILS_OPTS% %JAR_PATH% %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRAILS_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRAILS_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/test/groovy/greenfield/controllers/AccountControllerSpec.groovy b/src/test/groovy/greenfield/controllers/AccountControllerSpec.groovy new file mode 100644 index 00000000..46223c77 --- /dev/null +++ b/src/test/groovy/greenfield/controllers/AccountControllerSpec.groovy @@ -0,0 +1,24 @@ +package greenfield.controllers + +import grails.testing.web.controllers.ControllerUnitTest +import spock.lang.Specification + +import static org.springframework.http.HttpStatus.METHOD_NOT_ALLOWED + +import greenfield.AccountController + +class AccountControllerSpec extends Specification implements ControllerUnitTest { + + + void setup() { + } + + + void "test POST request"() { + when: + true == true + + then: + true == true + } +} \ No newline at end of file diff --git a/src/test/groovy/greenfield/domain/AccountSpec.groovy b/src/test/groovy/greenfield/domain/AccountSpec.groovy new file mode 100644 index 00000000..2b660971 --- /dev/null +++ b/src/test/groovy/greenfield/domain/AccountSpec.groovy @@ -0,0 +1,23 @@ +package greenfield.domain + +import spock.lang.Specification +import grails.testing.gorm.DomainUnitTest +import grails.testing.gorm.DataTest + +import org.greenfield.Account + +class AccountSpec extends Specification implements DataTest { + + void setupSpec(){ + mockDomain Account + } + + void "test basic persistence mocking"() { + setup: + def account = new Account(name: 'Robert Fripp', username: "robert", password: "robert", email: "robert@mail.com").save(flush:true) + + expect: + Account.count() == 1 + } + +} \ No newline at end of file diff --git a/src/test/groovy/greenfield/interceptors/AccountsActiveInterceptorSpec.groovy b/src/test/groovy/greenfield/interceptors/AccountsActiveInterceptorSpec.groovy index f45d7352..d3070f70 100644 --- a/src/test/groovy/greenfield/interceptors/AccountsActiveInterceptorSpec.groovy +++ b/src/test/groovy/greenfield/interceptors/AccountsActiveInterceptorSpec.groovy @@ -1,22 +1,18 @@ package greenfield.interceptors -import grails.test.mixin.TestFor +import grails.testing.web.interceptor.InterceptorUnitTest import spock.lang.Specification -/** - * See the API for {@link grails.test.mixin.web.ControllerUnitTestMixin} for usage instructions - */ -@TestFor(AccountsActiveInterceptor) -class AccountsActiveInterceptorSpec extends Specification { +class AccountsActiveInterceptorSpec extends Specification implements InterceptorUnitTest { + + /**~/(admin_list|admin_create|admin_edit|admin_show)/**/ - /**~/(admin_list|admin_create|admin_edit|admin_show)/**/ - void "Test accountsActive interceptor matching"() { - when:"A request matches the interceptor" - withRequest(controller: "account", action: "admin_list") + when: "A request matches the interceptor" + withRequest(controller: "account", action: "admin_list") then: "The interceptor does match" - interceptor.doesMatch() + interceptor.doesMatch() } } diff --git a/src/test/groovy/greenfield/interceptors/ImportActiveInterceptorSpec.groovy b/src/test/groovy/greenfield/interceptors/ImportActiveInterceptorSpec.groovy index b8c4c66e..38d47d5e 100644 --- a/src/test/groovy/greenfield/interceptors/ImportActiveInterceptorSpec.groovy +++ b/src/test/groovy/greenfield/interceptors/ImportActiveInterceptorSpec.groovy @@ -1,14 +1,10 @@ package greenfield.interceptors -import grails.test.mixin.TestFor +import grails.testing.web.interceptor.InterceptorUnitTest import spock.lang.Specification -/** - * See the API for {@link grails.test.mixin.web.ControllerUnitTestMixin} for usage instructions - */ -@TestFor(ImportActiveInterceptor) -class ImportActiveInterceptorSpec extends Specification { +class ImportActiveInterceptorSpec extends Specification implements InterceptorUnitTest { def setup() { } @@ -16,12 +12,12 @@ class ImportActiveInterceptorSpec extends Specification { def cleanup() { } - /**~/(index|uploads|import_products_view)/**/ + /**~/(index|uploads|import_products_view)/**/ void "Test importActive interceptor matching"() { - when:"A request matches the interceptor" - withRequest(controller:"configuration", action: "index") + when: "A request matches the interceptor" + withRequest(controller: "configuration", action: "index") - then:"The interceptor does match" - interceptor.doesMatch() + then: "The interceptor does match" + interceptor.doesMatch() } } diff --git a/src/test/groovy/greenfield/interceptors/LayoutActiveInterceptorSpec.groovy b/src/test/groovy/greenfield/interceptors/LayoutActiveInterceptorSpec.groovy index f43f8f94..0c552048 100644 --- a/src/test/groovy/greenfield/interceptors/LayoutActiveInterceptorSpec.groovy +++ b/src/test/groovy/greenfield/interceptors/LayoutActiveInterceptorSpec.groovy @@ -1,14 +1,10 @@ package greenfield.interceptors -import grails.test.mixin.TestFor +import grails.testing.web.interceptor.InterceptorUnitTest import spock.lang.Specification -/** - * See the API for {@link grails.test.mixin.web.ControllerUnitTestMixin} for usage instructions - */ -@TestFor(LayoutActiveInterceptor) -class LayoutActiveInterceptorSpec extends Specification { +class LayoutActiveInterceptorSpec extends Specification implements InterceptorUnitTest { def setup() { } @@ -16,12 +12,12 @@ class LayoutActiveInterceptorSpec extends Specification { def cleanup() { } - /**~/(index|tags|how)/**/ + /**~/(index|tags|how)/**/ void "Test layoutActive interceptor matching"() { - when:"A request matches the interceptor" - withRequest(controller:"layout", action: "index") + when: "A request matches the interceptor" + withRequest(controller: "layout", action: "index") - then:"The interceptor does match" - interceptor.doesMatch() + then: "The interceptor does match" + interceptor.doesMatch() } } diff --git a/src/test/groovy/greenfield/interceptors/PagesActiveInterceptorSpec.groovy b/src/test/groovy/greenfield/interceptors/PagesActiveInterceptorSpec.groovy index c2882d09..238eb1f8 100644 --- a/src/test/groovy/greenfield/interceptors/PagesActiveInterceptorSpec.groovy +++ b/src/test/groovy/greenfield/interceptors/PagesActiveInterceptorSpec.groovy @@ -1,14 +1,10 @@ package greenfield.interceptors -import grails.test.mixin.TestFor +import grails.testing.web.interceptor.InterceptorUnitTest import spock.lang.Specification -/** - * See the API for {@link grails.test.mixin.web.ControllerUnitTestMixin} for usage instructions - */ -@TestFor(PagesActiveInterceptor) -class PagesActiveInterceptorSpec extends Specification { +class PagesActiveInterceptorSpec extends Specification implements InterceptorUnitTest { def setup() { } @@ -16,13 +12,13 @@ class PagesActiveInterceptorSpec extends Specification { def cleanup() { } - - /**~/(list|create|edit|show)/**/ + + /**~/(list|create|edit|show)/**/ void "Test pagesActive interceptor matching"() { - when:"A request matches the interceptor" - withRequest(controller:"page", action: "list") + when: "A request matches the interceptor" + withRequest(controller: "page", action: "list") - then:"The interceptor does match" - interceptor.doesMatch() + then: "The interceptor does match" + interceptor.doesMatch() } } diff --git a/src/test/groovy/greenfield/interceptors/SettingsActiveInterceptorSpec.groovy b/src/test/groovy/greenfield/interceptors/SettingsActiveInterceptorSpec.groovy index 94cce8c3..7757928e 100644 --- a/src/test/groovy/greenfield/interceptors/SettingsActiveInterceptorSpec.groovy +++ b/src/test/groovy/greenfield/interceptors/SettingsActiveInterceptorSpec.groovy @@ -1,14 +1,10 @@ package greenfield.interceptors -import grails.test.mixin.TestFor +import grails.testing.web.interceptor.InterceptorUnitTest import spock.lang.Specification -/** - * See the API for {@link grails.test.mixin.web.ControllerUnitTestMixin} for usage instructions - */ -@TestFor(SettingsActiveInterceptor) -class SettingsActiveInterceptorSpec extends Specification { +class SettingsActiveInterceptorSpec extends Specification implements InterceptorUnitTest { def setup() { } @@ -17,12 +13,12 @@ class SettingsActiveInterceptorSpec extends Specification { } - /**~/(settings|email_settings|stripe_settings|shipping_settings)/**/ + /**~/(settings|email_settings|stripe_settings|shipping_settings)/**/ void "Test settingsActive interceptor matching"() { - when:"A request matches the interceptor" - withRequest(controller:"configuration", action:"settings") + when: "A request matches the interceptor" + withRequest(controller: "configuration", action: "settings") - then:"The interceptor does match" - interceptor.doesMatch() + then: "The interceptor does match" + interceptor.doesMatch() } }