Skip to content

Commit

Permalink
Remove ReportingGebSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
jdaugherty committed Dec 16, 2024
1 parent a1da663 commit 891308e
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package specs

import grails.testing.mixin.integration.Integration

@Integration
abstract class AbstractHyphenatedSecuritySpec extends AbstractSecuritySpec {

protected void resetDatabase() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
package specs

import com.testapp.TestDataService
import functional.test.app.Application
import geb.driver.CachingDriverFactory
import geb.spock.GebReportingSpec
import grails.plugin.geb.ContainerGebSpec
import grails.plugin.springsecurity.SpringSecurityCoreGrailsPlugin
import grails.plugin.springsecurity.SpringSecurityUtils
import grails.testing.mixin.integration.Integration
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.security.crypto.password.MessageDigestPasswordEncoder
import pages.LoginPage
import spock.lang.Shared
import spock.lang.Stepwise

@Integration(applicationClass = functional.test.app.Application)
@Stepwise
abstract class AbstractSecuritySpec extends GebReportingSpec {
@Integration(applicationClass = Application)
abstract class AbstractSecuritySpec extends ContainerGebSpec {

private @Shared boolean databaseReset = false

@Autowired
TestDataService testDataService

void setup() {
if ( hasProperty('serverPort') ) {
browser.baseUrl = "http://localhost:${getProperty('serverPort')}/"
} else {
browser.baseUrl = 'http://localhost:8080/'
}

logout()

// call resetDatabase() once per suite, before the first test; would
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package specs

import grails.testing.mixin.integration.Integration
import pages.IndexPage
import pages.LoginPage
import pages.role.CreateRolePage
Expand All @@ -10,6 +11,7 @@ import pages.user.ListUserPage
import pages.user.ShowUserPage
import spock.lang.IgnoreIf

@Integration
@IgnoreIf({ System.getProperty('TESTCONFIG') != 'annotation' })
class AnnotationSecuritySpec extends AbstractSecuritySpec {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package specs

import grails.testing.mixin.integration.Integration
import pages.user.CreateUserPage
import pages.user.ListUserPage
import pages.user.ShowUserPage
import spock.lang.IgnoreIf

@Integration
@IgnoreIf({ System.getProperty('TESTCONFIG') != 'bcrypt' })
class BCryptSpec extends AbstractSecuritySpec {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package specs

import grails.testing.mixin.integration.Integration
import org.springframework.security.core.userdetails.UserCache
import pages.LoginPage
import pages.role.CreateRolePage
Expand All @@ -10,6 +11,7 @@ import pages.user.ListUserPage
import pages.user.ShowUserPage
import spock.lang.IgnoreIf

@Integration
@IgnoreIf({ System.getProperty('TESTCONFIG') != 'basicCacheUsers' })
class BasicAuthCacheUsersSecuritySpec extends AbstractSecuritySpec {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package specs

import grails.testing.mixin.integration.Integration
import pages.LoginPage
import pages.role.CreateRolePage
import pages.role.ListRolePage
Expand All @@ -9,6 +10,7 @@ import pages.user.ListUserPage
import pages.user.ShowUserPage
import spock.lang.IgnoreIf

@Integration
@IgnoreIf({ System.getProperty('TESTCONFIG') != 'basic' })
class BasicAuthSecuritySpec extends AbstractSecuritySpec {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package specs

import grails.testing.mixin.integration.Integration
import pages.IndexPage
import spock.lang.IgnoreIf


@Integration
@IgnoreIf({ System.getProperty('TESTCONFIG') != 'misc' })
class DisableSpec extends AbstractHyphenatedSecuritySpec {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package specs

import grails.testing.mixin.integration.Integration
import pages.IndexPage
import pages.LoginPage
import spock.lang.IgnoreIf

@Integration
@IgnoreIf({ System.getProperty('TESTCONFIG') != 'annotation' })
class InheritanceSecuritySpec extends AbstractSecuritySpec {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package specs

import geb.module.TextInput
import grails.testing.mixin.integration.Integration
import org.springframework.security.crypto.password.PasswordEncoder
import pages.IndexPage
import spock.lang.IgnoreIf
import spock.lang.Issue

@Integration
@IgnoreIf({ System.getProperty('TESTCONFIG') != 'misc' })
class MiscSpec extends AbstractHyphenatedSecuritySpec {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package specs

import grails.testing.mixin.integration.Integration
import groovy.json.JsonSlurper
import pages.IndexPage
import pages.LoginPage
import spock.lang.IgnoreIf
import spock.lang.Unroll

@Integration
@IgnoreIf({ System.getProperty('TESTCONFIG') != 'annotation' })
class NamespaceSecuritySpec extends AbstractSecuritySpec {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package specs

import com.testapp.TestDataService
import grails.testing.mixin.integration.Integration
import pages.IndexPage
import pages.LoginPage
import pages.requestmap.CreateRequestmapPage
Expand All @@ -14,6 +15,7 @@ import pages.user.ListUserPage
import pages.user.ShowUserPage
import spock.lang.IgnoreIf

@Integration
@IgnoreIf({ System.getProperty('TESTCONFIG') != 'requestmap' })
class RequestmapSecuritySpec extends AbstractSecuritySpec {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package specs

import com.testapp.TestDataService
import grails.testing.mixin.integration.Integration
import pages.requestmap.CreateRequestmapPage
import pages.requestmap.EditRequestmapPage
import pages.requestmap.ListRequestmapPage
import pages.requestmap.ShowRequestmapPage
import spock.lang.IgnoreIf

@Integration
@IgnoreIf({ System.getProperty('TESTCONFIG') != 'requestmap' })
class RequestmapSpec extends AbstractSecuritySpec {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package specs

import grails.testing.mixin.integration.Integration
import pages.role.CreateRolePage
import pages.role.EditRolePage
import pages.role.ListRolePage
import pages.role.ShowRolePage
import spock.lang.IgnoreIf

@Integration
@IgnoreIf({ !(
System.getProperty('TESTCONFIG') == 'annotation' ||
System.getProperty('TESTCONFIG') == 'basic' ||
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package specs

import grails.testing.mixin.integration.Integration
import pages.IndexPage
import pages.role.CreateRolePage
import pages.role.ListRolePage
Expand All @@ -9,6 +10,7 @@ import pages.user.ListUserPage
import pages.user.ShowUserPage
import spock.lang.IgnoreIf

@Integration
@IgnoreIf({ System.getProperty('TESTCONFIG') != 'static' })
class StaticSecuritySpec extends AbstractSecuritySpec {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package specs

import grails.testing.mixin.integration.Integration
import pages.user.CreateUserPage
import pages.user.EditUserPage
import pages.user.ListUserPage
import pages.user.ShowUserPage
import spock.lang.IgnoreIf

@Integration
@IgnoreIf({ !(
System.getProperty('TESTCONFIG') == 'annotation' ||
System.getProperty('TESTCONFIG') == 'basic' ||
Expand Down

0 comments on commit 891308e

Please sign in to comment.