Skip to content

Commit

Permalink
fix for GRAILS-12004 "Filter class is not picked up."
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed Feb 24, 2015
1 parent e5ce2bf commit c9e9460
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ class GlobalGrailsClassInjectorTransformation implements ASTTransformation, Comp
}

protected boolean updateGrailsFactoriesWithType(ClassNode classNode, ClassNode superType, File compilationTargetDirectory) {
if (GrailsASTUtils.isSubclassOfOrImplementsInterface(classNode, superType)
&& classNode.name != 'org.grails.plugins.web.filters.FiltersConfigArtefactHandler') {
if (GrailsASTUtils.isSubclassOfOrImplementsInterface(classNode, superType)) {
def classNodeName = classNode.name
// generate META-INF/grails.factories
def factoriesFile = new File(compilationTargetDirectory, "META-INF/grails.factories")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ class FiltersGrailsPlugin implements GrailsApplicationAware, ApplicationContextA
ApplicationContext applicationContext

static final BEANS = { GrailsClass filter ->
def app = grailsApplication
"${filter.fullName}Class"(MethodInvokingFactoryBean) {
targetObject = ref("grailsApplication", true)
targetObject = app
targetMethod = "getArtefact"
arguments = [TYPE, filter.fullName]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package grails.test.mixin

import grails.artefact.Artefact
import grails.test.mixin.web.FiltersUnitTestMixin

import grails.test.runtime.FreshRuntime
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.springframework.beans.factory.config.MethodInvokingFactoryBean

@TestMixin(FiltersUnitTestMixin)
@FreshRuntime
class FiltersUnitTestMixinTests {

AuthorController controller
Expand Down

0 comments on commit c9e9460

Please sign in to comment.