diff --git a/examples/extended/build.gradle b/examples/extended/build.gradle index 05e4192b..7ebdd137 100644 --- a/examples/extended/build.gradle +++ b/examples/extended/build.gradle @@ -37,12 +37,11 @@ dependencies { implementation "org.grails:grails-plugin-services" implementation "org.grails:grails-plugin-url-mappings" implementation "org.grails:grails-plugin-interceptors" - implementation "org.grails.plugins:cache" implementation "org.grails.plugins:async" implementation "org.grails.plugins:scaffolding" implementation "org.grails.plugins:events" implementation "org.grails.plugins:hibernate5" - implementation "org.hibernate:hibernate-core:$hibernateCoreVersion" + implementation "org.hibernate:hibernate-core-jakarta:$hibernateCoreVersion" implementation "org.grails.plugins:gsp" console "org.grails:grails-console" profile "org.grails.profiles:web" diff --git a/examples/extended/grails-app/conf/application.yml b/examples/extended/grails-app/conf/application.yml index 31c91a88..58fc6efd 100644 --- a/examples/extended/grails-app/conf/application.yml +++ b/examples/extended/grails-app/conf/application.yml @@ -1,143 +1,66 @@ ---- -grails: - profile: web - codegen: - defaultPackage: test - spring: - transactionManagement: - proxies: false - gorm: - # Whether to autowire entities. - # Disabled by default for performance reasons. - autowire: false - reactor: - # Whether to translate GORM events into Reactor events - # Disabled by default for performance reasons - events: false info: - app: - name: '@info.app.name@' - version: '@info.app.version@' - grailsVersion: '@info.app.grailsVersion@' -spring: - main: - banner-mode: "off" - groovy: - template: - check-template-location: false - -# Spring Actuator Endpoints are Disabled by Default -endpoints: - enabled: false - jmx: - enabled: true - ---- + app: + name: '@info.app.name@' + version: '@info.app.version@' + grailsVersion: '@info.app.grailsVersion@' grails: - mime: - disable: - accept: - header: - userAgents: - - Gecko - - WebKit - - Presto - - Trident - types: - all: '*/*' - atom: application/atom+xml - css: text/css - csv: text/csv - form: application/x-www-form-urlencoded - html: - - text/html - - application/xhtml+xml - js: text/javascript - json: - - application/json - - text/json - multipartForm: multipart/form-data - pdf: application/pdf - rss: application/rss+xml - text: text/plain - hal: - - application/hal+json - - application/hal+xml - xml: - - text/xml - - application/xml - urlmapping: - cache: - maxsize: 1000 - controllers: - defaultScope: singleton - converters: - encoding: UTF-8 - views: - default: - codec: html - gsp: - encoding: UTF-8 - htmlcodec: xml - codecs: - expression: html - scriptlets: html - taglib: none - staticparts: none -endpoints: - jmx: - unique-names: true - ---- ---- -hibernate: - cache: - queries: false - use_query_cache: false - use_second_level_cache: false - format_sql: true - use_sql_comments: true - + views: + default: + codec: html + gsp: + encoding: UTF-8 + htmlcodec: xml + codecs: + expression: html + scriptlet: html + taglib: none + staticparts: none + mime: + disable: + accept: + header: + userAgents: + - Gecko + - WebKit + - Presto + - Trident + types: + all: '*/*' + atom: application/atom+xml + css: text/css + csv: text/csv + form: application/x-www-form-urlencoded + html: + - text/html + - application/xhtml+xml + js: text/javascript + json: + - application/json + - text/json + multipartForm: multipart/form-data + pdf: application/pdf + rss: application/rss+xml + text: text/plain + hal: + - application/hal+json + - application/hal+xml + xml: + - text/xml + - application/xml dataSource: - dbCreate: update - driverClassName: org.h2.Driver - jmxExport: true - password: - pooled: true - url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE - username: sa + url: jdbc:h2:mem:devDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE + driverClassName: org.h2.Driver + username: sa + password: '' + pooled: true + jmxExport: true + dbCreate: update +hibernate: + cache: + queries: false + use_second_level_cache: false + use_query_cache: false -environments: - development: - dataSource: - dbCreate: create-drop - url: jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE - test: - dataSource: - dbCreate: create-drop - url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE - production: - dataSource: - dbCreate: none - url: jdbc:h2:./prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE - properties: - jmxEnabled: true - initialSize: 5 - maxActive: 50 - minIdle: 5 - maxIdle: 25 - maxWait: 10000 - maxAge: 600000 - timeBetweenEvictionRunsMillis: 5000 - minEvictableIdleTimeMillis: 60000 - validationQuery: SELECT 1 - validationQueryTimeout: 3 - validationInterval: 15000 - testOnBorrow: true - testWhileIdle: true - testOnReturn: false - jdbcInterceptors: ConnectionState - defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED --- grails: mail: diff --git a/examples/extended/grails-app/domain/test/User.groovy b/examples/extended/grails-app/domain/test/User.groovy index 73d8719b..28b5dcd8 100644 --- a/examples/extended/grails-app/domain/test/User.groovy +++ b/examples/extended/grails-app/domain/test/User.groovy @@ -47,6 +47,10 @@ class User implements Serializable { static transients = ['springSecurityService'] + static mapping = { + table name: '`user`' + } + static constraints = { email nullable: true, email: true, unique: true username unique: true diff --git a/examples/extended/src/integration-test/groovy/spec/AclClassSpec.groovy b/examples/extended/src/integration-test/groovy/spec/AclClassSpec.groovy index b178d817..327a80c1 100644 --- a/examples/extended/src/integration-test/groovy/spec/AclClassSpec.groovy +++ b/examples/extended/src/integration-test/groovy/spec/AclClassSpec.groovy @@ -1,22 +1,11 @@ package spec +import grails.testing.mixin.integration.Integration import page.aclClass.AclClassCreatePage import page.aclClass.AclClassEditPage import page.aclClass.AclClassSearchPage -import spock.lang.IgnoreIf -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +@Integration class AclClassSpec extends AbstractSecuritySpec { void testFindAll() { diff --git a/examples/extended/src/integration-test/groovy/spec/AclEntrySpec.groovy b/examples/extended/src/integration-test/groovy/spec/AclEntrySpec.groovy index e8af0455..68f8da8d 100644 --- a/examples/extended/src/integration-test/groovy/spec/AclEntrySpec.groovy +++ b/examples/extended/src/integration-test/groovy/spec/AclEntrySpec.groovy @@ -1,22 +1,11 @@ package spec +import grails.testing.mixin.integration.Integration import page.aclEntry.AclEntryCreatePage import page.aclEntry.AclEntryEditPage import page.aclEntry.AclEntrySearchPage -import spock.lang.IgnoreIf -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +@Integration class AclEntrySpec extends AbstractSecuritySpec { void testFindAll() { diff --git a/examples/extended/src/integration-test/groovy/spec/AclObjectIdentitySpec.groovy b/examples/extended/src/integration-test/groovy/spec/AclObjectIdentitySpec.groovy index c946032f..38e38b53 100644 --- a/examples/extended/src/integration-test/groovy/spec/AclObjectIdentitySpec.groovy +++ b/examples/extended/src/integration-test/groovy/spec/AclObjectIdentitySpec.groovy @@ -1,22 +1,11 @@ package spec +import grails.testing.mixin.integration.Integration import page.aclObjectIdentity.AclObjectIdentityCreatePage import page.aclObjectIdentity.AclObjectIdentityEditPage import page.aclObjectIdentity.AclObjectIdentitySearchPage -import spock.lang.IgnoreIf -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +@Integration class AclObjectIdentitySpec extends AbstractSecuritySpec { void testFindAll() { diff --git a/examples/extended/src/integration-test/groovy/spec/AclSidSpec.groovy b/examples/extended/src/integration-test/groovy/spec/AclSidSpec.groovy index 460d2781..d97f1ed8 100644 --- a/examples/extended/src/integration-test/groovy/spec/AclSidSpec.groovy +++ b/examples/extended/src/integration-test/groovy/spec/AclSidSpec.groovy @@ -1,22 +1,11 @@ package spec +import grails.testing.mixin.integration.Integration import page.aclSid.AclSidCreatePage import page.aclSid.AclSidEditPage import page.aclSid.AclSidSearchPage -import spock.lang.IgnoreIf -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +@Integration class AclSidSpec extends AbstractSecuritySpec { void testFindAll() { diff --git a/examples/extended/src/integration-test/groovy/spec/ExtendedMenuSpec.groovy b/examples/extended/src/integration-test/groovy/spec/ExtendedMenuSpec.groovy index ae71d8fc..47d6e97c 100644 --- a/examples/extended/src/integration-test/groovy/spec/ExtendedMenuSpec.groovy +++ b/examples/extended/src/integration-test/groovy/spec/ExtendedMenuSpec.groovy @@ -1,19 +1,8 @@ package spec -import spock.lang.IgnoreIf - -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +import grails.testing.mixin.integration.Integration + +@Integration class ExtendedMenuSpec extends AbstractSecuritySpec { void testIndex() { diff --git a/examples/extended/src/integration-test/groovy/spec/ExtendedSecurityInfoSpec.groovy b/examples/extended/src/integration-test/groovy/spec/ExtendedSecurityInfoSpec.groovy index 2a8c6db8..a398e660 100644 --- a/examples/extended/src/integration-test/groovy/spec/ExtendedSecurityInfoSpec.groovy +++ b/examples/extended/src/integration-test/groovy/spec/ExtendedSecurityInfoSpec.groovy @@ -1,19 +1,8 @@ package spec -import spock.lang.IgnoreIf - -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +import grails.testing.mixin.integration.Integration + +@Integration class ExtendedSecurityInfoSpec extends AbstractSecuritySpec { void testConfig() { diff --git a/examples/extended/src/integration-test/groovy/spec/PersistentLoginSpec.groovy b/examples/extended/src/integration-test/groovy/spec/PersistentLoginSpec.groovy index a44e8aea..d962ab74 100644 --- a/examples/extended/src/integration-test/groovy/spec/PersistentLoginSpec.groovy +++ b/examples/extended/src/integration-test/groovy/spec/PersistentLoginSpec.groovy @@ -1,20 +1,9 @@ package spec +import grails.testing.mixin.integration.Integration import page.persistentLogin.PersistentLoginSearchPage -import spock.lang.IgnoreIf -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +@Integration class PersistentLoginSpec extends AbstractSecuritySpec { void testFindAll() { diff --git a/examples/extended/src/integration-test/groovy/spec/RegisterSpec.groovy b/examples/extended/src/integration-test/groovy/spec/RegisterSpec.groovy index 537f0916..99dc17eb 100644 --- a/examples/extended/src/integration-test/groovy/spec/RegisterSpec.groovy +++ b/examples/extended/src/integration-test/groovy/spec/RegisterSpec.groovy @@ -2,6 +2,7 @@ package spec import com.dumbster.smtp.SimpleSmtpServer import com.dumbster.smtp.SmtpMessage +import grails.testing.mixin.integration.Integration import page.profile.ProfileEditPage import page.profile.ProfileListPage import page.register.ForgotPasswordPage @@ -10,22 +11,9 @@ import page.register.SecurityQuestionsPage import page.profile.ProfileCreatePage import page.user.UserEditPage import page.user.UserSearchPage -import spock.lang.IgnoreIf import page.register.ResetPasswordPage -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) - +@Integration class RegisterSpec extends AbstractSecuritySpec { private SimpleSmtpServer server diff --git a/examples/extended/src/integration-test/groovy/spec/RegistrationCodeSpec.groovy b/examples/extended/src/integration-test/groovy/spec/RegistrationCodeSpec.groovy index 8684aa29..4a99b4c5 100644 --- a/examples/extended/src/integration-test/groovy/spec/RegistrationCodeSpec.groovy +++ b/examples/extended/src/integration-test/groovy/spec/RegistrationCodeSpec.groovy @@ -1,21 +1,10 @@ package spec +import grails.testing.mixin.integration.Integration import page.registrationCode.RegistrationCodeEditPage import page.registrationCode.RegistrationCodeSearchPage -import spock.lang.IgnoreIf -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +@Integration class RegistrationCodeSpec extends AbstractSecuritySpec { void testFindAll() { diff --git a/examples/extended/src/integration-test/groovy/spec/RequestmapSpec.groovy b/examples/extended/src/integration-test/groovy/spec/RequestmapSpec.groovy index ca7dc8b6..68325929 100644 --- a/examples/extended/src/integration-test/groovy/spec/RequestmapSpec.groovy +++ b/examples/extended/src/integration-test/groovy/spec/RequestmapSpec.groovy @@ -1,22 +1,11 @@ package spec +import grails.testing.mixin.integration.Integration import page.requestmap.RequestmapCreatePage import page.requestmap.RequestmapEditPage import page.requestmap.RequestmapSearchPage -import spock.lang.IgnoreIf -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +@Integration class RequestmapSpec extends AbstractSecuritySpec { void testFindAll() { diff --git a/examples/extended/src/integration-test/groovy/spec/RoleSpec.groovy b/examples/extended/src/integration-test/groovy/spec/RoleSpec.groovy index 84f0a5e6..ca6a3f75 100644 --- a/examples/extended/src/integration-test/groovy/spec/RoleSpec.groovy +++ b/examples/extended/src/integration-test/groovy/spec/RoleSpec.groovy @@ -1,22 +1,11 @@ package spec +import grails.testing.mixin.integration.Integration import page.role.RoleCreatePage import page.role.RoleEditPage import page.role.RoleSearchPage -import spock.lang.IgnoreIf -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +@Integration class RoleSpec extends AbstractSecuritySpec { void testFindAll() { diff --git a/examples/extended/src/integration-test/groovy/spec/UserSpec.groovy b/examples/extended/src/integration-test/groovy/spec/UserSpec.groovy index 918f5c1d..1035371c 100644 --- a/examples/extended/src/integration-test/groovy/spec/UserSpec.groovy +++ b/examples/extended/src/integration-test/groovy/spec/UserSpec.groovy @@ -1,22 +1,11 @@ package spec +import grails.testing.mixin.integration.Integration import page.user.UserCreatePage import page.user.UserEditPage import page.user.UserSearchPage -import spock.lang.IgnoreIf -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +@Integration class UserSpec extends AbstractSecuritySpec { void testFindAll() { diff --git a/examples/simple/build.gradle b/examples/simple/build.gradle index 584ba6be..e5264a7e 100644 --- a/examples/simple/build.gradle +++ b/examples/simple/build.gradle @@ -37,12 +37,11 @@ dependencies { implementation "org.grails:grails-plugin-services" implementation "org.grails:grails-plugin-url-mappings" implementation "org.grails:grails-plugin-interceptors" - implementation "org.grails.plugins:cache" implementation "org.grails.plugins:async" implementation "org.grails.plugins:scaffolding" implementation "org.grails.plugins:events" implementation "org.grails.plugins:hibernate5" - implementation "org.hibernate:hibernate-core:$hibernateCoreVersion" + implementation "org.hibernate:hibernate-core-jakarta:$hibernateCoreVersion" implementation "org.grails.plugins:gsp" console "org.grails:grails-console" profile "org.grails.profiles:web" diff --git a/examples/simple/grails-app/conf/application.yml b/examples/simple/grails-app/conf/application.yml index 2413299d..474c8e6c 100644 --- a/examples/simple/grails-app/conf/application.yml +++ b/examples/simple/grails-app/conf/application.yml @@ -1,143 +1,65 @@ ---- -grails: - profile: web - codegen: - defaultPackage: test - spring: - transactionManagement: - proxies: false - gorm: - # Whether to autowire entities. - # Disabled by default for performance reasons. - autowire: false - reactor: - # Whether to translate GORM events into Reactor events - # Disabled by default for performance reasons - events: false info: - app: - name: '@info.app.name@' - version: '@info.app.version@' - grailsVersion: '@info.app.grailsVersion@' -spring: - main: - banner-mode: "off" - groovy: - template: - check-template-location: false - -# Spring Actuator Endpoints are Disabled by Default -endpoints: - enabled: false - jmx: - enabled: true - ---- + app: + name: '@info.app.name@' + version: '@info.app.version@' + grailsVersion: '@info.app.grailsVersion@' grails: - mime: - disable: - accept: - header: - userAgents: - - Gecko - - WebKit - - Presto - - Trident - types: - all: '*/*' - atom: application/atom+xml - css: text/css - csv: text/csv - form: application/x-www-form-urlencoded - html: - - text/html - - application/xhtml+xml - js: text/javascript - json: - - application/json - - text/json - multipartForm: multipart/form-data - pdf: application/pdf - rss: application/rss+xml - text: text/plain - hal: - - application/hal+json - - application/hal+xml - xml: - - text/xml - - application/xml - urlmapping: - cache: - maxsize: 1000 - controllers: - defaultScope: singleton - converters: - encoding: UTF-8 - views: - default: - codec: html - gsp: - encoding: UTF-8 - htmlcodec: xml - codecs: - expression: html - scriptlets: html - taglib: none - staticparts: none -endpoints: - jmx: - unique-names: true - ---- ---- -hibernate: - cache: - queries: false - use_query_cache: false - use_second_level_cache: false - format_sql: true - use_sql_comments: true - + views: + default: + codec: html + gsp: + encoding: UTF-8 + htmlcodec: xml + codecs: + expression: html + scriptlet: html + taglib: none + staticparts: none + mime: + disable: + accept: + header: + userAgents: + - Gecko + - WebKit + - Presto + - Trident + types: + all: '*/*' + atom: application/atom+xml + css: text/css + csv: text/csv + form: application/x-www-form-urlencoded + html: + - text/html + - application/xhtml+xml + js: text/javascript + json: + - application/json + - text/json + multipartForm: multipart/form-data + pdf: application/pdf + rss: application/rss+xml + text: text/plain + hal: + - application/hal+json + - application/hal+xml + xml: + - text/xml + - application/xml dataSource: - dbCreate: update - driverClassName: org.h2.Driver - jmxExport: true - password: - pooled: true - url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE - username: sa - -environments: - development: - dataSource: - dbCreate: create-drop - url: jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE - test: - dataSource: - dbCreate: update - url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE - production: - dataSource: - dbCreate: none - url: jdbc:h2:./prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE - properties: - jmxEnabled: true - initialSize: 5 - maxActive: 50 - minIdle: 5 - maxIdle: 25 - maxWait: 10000 - maxAge: 600000 - timeBetweenEvictionRunsMillis: 5000 - minEvictableIdleTimeMillis: 60000 - validationQuery: SELECT 1 - validationQueryTimeout: 3 - validationInterval: 15000 - testOnBorrow: true - testWhileIdle: true - testOnReturn: false - jdbcInterceptors: ConnectionState - defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED + url: jdbc:h2:mem:devDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE + driverClassName: org.h2.Driver + username: sa + password: '' + pooled: true + jmxExport: true + dbCreate: update +hibernate: + cache: + queries: false + use_second_level_cache: false + use_query_cache: false --- grails: mail: @@ -193,4 +115,4 @@ grails: userLookup: authorityJoinClassName: test.UserRole userDomainClassName: test.User - useSwitchUserFilter: true \ No newline at end of file + useSwitchUserFilter: true diff --git a/examples/simple/grails-app/domain/test/User.groovy b/examples/simple/grails-app/domain/test/User.groovy index 73d8719b..28b5dcd8 100644 --- a/examples/simple/grails-app/domain/test/User.groovy +++ b/examples/simple/grails-app/domain/test/User.groovy @@ -47,6 +47,10 @@ class User implements Serializable { static transients = ['springSecurityService'] + static mapping = { + table name: '`user`' + } + static constraints = { email nullable: true, email: true, unique: true username unique: true diff --git a/examples/simple/src/integration-test/groovy/spec/DefaultMenuSpec.groovy b/examples/simple/src/integration-test/groovy/spec/DefaultMenuSpec.groovy index baebd632..755ac7b8 100644 --- a/examples/simple/src/integration-test/groovy/spec/DefaultMenuSpec.groovy +++ b/examples/simple/src/integration-test/groovy/spec/DefaultMenuSpec.groovy @@ -1,19 +1,8 @@ package spec -import spock.lang.IgnoreIf +import grails.testing.mixin.integration.Integration -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +@Integration class DefaultMenuSpec extends AbstractSecuritySpec { void testIndex() { diff --git a/examples/simple/src/integration-test/groovy/spec/DefaultSecurityInfoSpec.groovy b/examples/simple/src/integration-test/groovy/spec/DefaultSecurityInfoSpec.groovy index a17958be..8ebe889b 100644 --- a/examples/simple/src/integration-test/groovy/spec/DefaultSecurityInfoSpec.groovy +++ b/examples/simple/src/integration-test/groovy/spec/DefaultSecurityInfoSpec.groovy @@ -1,19 +1,8 @@ package spec -import spock.lang.IgnoreIf +import grails.testing.mixin.integration.Integration -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +@Integration class DefaultSecurityInfoSpec extends AbstractSecuritySpec { void testConfig() { diff --git a/examples/simple/src/integration-test/groovy/spec/RegisterSpec.groovy b/examples/simple/src/integration-test/groovy/spec/RegisterSpec.groovy index cea13cb3..de14e75c 100644 --- a/examples/simple/src/integration-test/groovy/spec/RegisterSpec.groovy +++ b/examples/simple/src/integration-test/groovy/spec/RegisterSpec.groovy @@ -1,5 +1,6 @@ package spec +import grails.testing.mixin.integration.Integration import page.register.ForgotPasswordPage import page.register.RegisterPage import page.user.UserEditPage @@ -7,20 +8,8 @@ import page.user.UserSearchPage import com.dumbster.smtp.SimpleSmtpServer import com.dumbster.smtp.SmtpMessage -import spock.lang.IgnoreIf -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +@Integration class RegisterSpec extends AbstractSecuritySpec { private SimpleSmtpServer server diff --git a/examples/simple/src/integration-test/groovy/spec/RegistrationCodeSpec.groovy b/examples/simple/src/integration-test/groovy/spec/RegistrationCodeSpec.groovy index 8684aa29..4a99b4c5 100644 --- a/examples/simple/src/integration-test/groovy/spec/RegistrationCodeSpec.groovy +++ b/examples/simple/src/integration-test/groovy/spec/RegistrationCodeSpec.groovy @@ -1,21 +1,10 @@ package spec +import grails.testing.mixin.integration.Integration import page.registrationCode.RegistrationCodeEditPage import page.registrationCode.RegistrationCodeSearchPage -import spock.lang.IgnoreIf -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +@Integration class RegistrationCodeSpec extends AbstractSecuritySpec { void testFindAll() { diff --git a/examples/simple/src/integration-test/groovy/spec/RequestmapSpec.groovy b/examples/simple/src/integration-test/groovy/spec/RequestmapSpec.groovy index ca7dc8b6..68325929 100644 --- a/examples/simple/src/integration-test/groovy/spec/RequestmapSpec.groovy +++ b/examples/simple/src/integration-test/groovy/spec/RequestmapSpec.groovy @@ -1,22 +1,11 @@ package spec +import grails.testing.mixin.integration.Integration import page.requestmap.RequestmapCreatePage import page.requestmap.RequestmapEditPage import page.requestmap.RequestmapSearchPage -import spock.lang.IgnoreIf -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +@Integration class RequestmapSpec extends AbstractSecuritySpec { void testFindAll() { diff --git a/examples/simple/src/integration-test/groovy/spec/RoleSpec.groovy b/examples/simple/src/integration-test/groovy/spec/RoleSpec.groovy index 84f0a5e6..9f2bfc4f 100644 --- a/examples/simple/src/integration-test/groovy/spec/RoleSpec.groovy +++ b/examples/simple/src/integration-test/groovy/spec/RoleSpec.groovy @@ -1,22 +1,10 @@ package spec +import grails.testing.mixin.integration.Integration import page.role.RoleCreatePage import page.role.RoleEditPage import page.role.RoleSearchPage -import spock.lang.IgnoreIf -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) class RoleSpec extends AbstractSecuritySpec { void testFindAll() { diff --git a/examples/simple/src/integration-test/groovy/spec/UserSimpleSpec.groovy b/examples/simple/src/integration-test/groovy/spec/UserSimpleSpec.groovy index 678e6487..06e8fa42 100644 --- a/examples/simple/src/integration-test/groovy/spec/UserSimpleSpec.groovy +++ b/examples/simple/src/integration-test/groovy/spec/UserSimpleSpec.groovy @@ -1,24 +1,12 @@ package spec +import grails.testing.mixin.integration.Integration import page.user.UserCreatePage import page.user.UserEditPage import page.user.UserSearchPage -import spock.lang.IgnoreIf -import spock.lang.IgnoreRest import spock.lang.Issue -@IgnoreIf({ - if (!System.getProperty('geb.env')) { - return true - } - if (System.getProperty('geb.env') == 'phantomjs' && !System.getProperty('phantomjs.binary.path')) { - return true - } - if (System.getProperty('geb.env') == 'chrome' && !System.getProperty('webdriver.chrome.driver')) { - return true - } - false -}) +@Integration class UserSimpleSpec extends AbstractSecuritySpec { void testFindAll() { diff --git a/plugin/build.gradle b/plugin/build.gradle index aa7380ce..807ebbe5 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -76,7 +76,6 @@ dependencies { implementation "org.grails:grails-plugin-services" implementation "org.grails:grails-plugin-url-mappings" implementation "org.grails:grails-plugin-interceptors" - implementation "org.grails.plugins:cache" implementation "org.grails.plugins:gsp" console "org.grails:grails-console" profile "org.grails.profiles:web-plugin" @@ -84,8 +83,9 @@ dependencies { compileOnly "org.grails:grails-plugin-domain-class" runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails:$assetPipelineVersion" api "org.grails.plugins:spring-security-core:$springSecurityCoreVersion" - testCompileOnly "org.grails:grails-gorm-testing-support" - testCompileOnly "org.grails:grails-web-testing-support" + testImplementation "org.grails:grails-gorm-testing-support" + testImplementation "org.grails:grails-web-testing-support" + testImplementation "org.spockframework:spock-core" implementation "org.springframework.security:spring-security-core", { ['spring-aop', 'spring-beans', 'spring-context', 'spring-core', 'spring-expression'].each { exclude module: it diff --git a/plugin/grails-app/conf/application.yml b/plugin/grails-app/conf/application.yml index 45c04360..7b75f40c 100644 --- a/plugin/grails-app/conf/application.yml +++ b/plugin/grails-app/conf/application.yml @@ -1,89 +1,5 @@ ---- -grails: - profile: web-plugin - codegen: - defaultPackage: grails.plugin.springsecurity.ui - spring: - transactionManagement: - proxies: false - gorm: - # Whether to autowire entities. - # Disabled by default for performance reasons. - autowire: false - reactor: - # Whether to translate GORM events into Reactor events - # Disabled by default for performance reasons - events: false info: - app: - name: '@info.app.name@' - version: '@info.app.version@' - grailsVersion: '@info.app.grailsVersion@' -spring: - main: - banner-mode: "off" - groovy: - template: - check-template-location: false - -# Spring Actuator Endpoints are Disabled by Default -endpoints: - enabled: false - jmx: - enabled: true - ---- -grails: - mime: - disable: - accept: - header: - userAgents: - - Gecko - - WebKit - - Presto - - Trident - types: - all: '*/*' - atom: application/atom+xml - css: text/css - csv: text/csv - form: application/x-www-form-urlencoded - html: - - text/html - - application/xhtml+xml - js: text/javascript - json: - - application/json - - text/json - multipartForm: multipart/form-data - pdf: application/pdf - rss: application/rss+xml - text: text/plain - hal: - - application/hal+json - - application/hal+xml - xml: - - text/xml - - application/xml - urlmapping: - cache: - maxsize: 1000 - controllers: - defaultScope: singleton - converters: - encoding: UTF-8 - views: - default: - codec: html - gsp: - encoding: UTF-8 - htmlcodec: xml - codecs: - expression: html - scriptlets: html - taglib: none - staticparts: none -endpoints: - jmx: - unique-names: true + app: + name: '@info.app.name@' + version: '@info.app.version@' + grailsVersion: '@info.app.grailsVersion@' diff --git a/plugin/src/test/groovy/grails/plugin/springsecurity/ui/RegisterControllerSpec.groovy b/plugin/src/test/groovy/grails/plugin/springsecurity/ui/RegisterControllerSpec.groovy index 2cc4fd3c..61ccb3b4 100644 --- a/plugin/src/test/groovy/grails/plugin/springsecurity/ui/RegisterControllerSpec.groovy +++ b/plugin/src/test/groovy/grails/plugin/springsecurity/ui/RegisterControllerSpec.groovy @@ -9,7 +9,7 @@ import spock.lang.Unroll class RegisterControllerSpec extends Specification implements ControllerUnitTest { void setup() { - SpringSecurityUtils.setSecurityConfig [:] as ConfigObject + SpringSecurityUtils.setSecurityConfig([:] as ConfigObject) } void cleanup() {