Disable Grails plugin -
In my Grails app, I want to stop detection of plug-ins by loading while running my unit tests. I tried to do this by using the following code in the bootstrap class
def grailsApplication def init = {servletContext -> Def currentEnv = grails.util.Environment.current.name if (currentEnv == 'test') {def doNothing = {println "Searchable is disabled"} // This return is empty! DEF Searchable plugin class = grailsApplication.getClassForName ("Searchable Grilles Plugin") Searchable plugin class. MetaCalash.Davath DynamicMutts = No SearchPlugin Class. Metagascar.DavithSpring = There is no search plugin plugins. Metaclass.DudeApplicationContax = Doing No}}
Although this is not work because grailsApplication.getClassForName ("SearchableGrailsPlugin")
return zero, possibly because this class is not on classpath This code is when it runs. Is there any other way that I can disable this plug-in?
I found a solution Add the following to Config.groovy:
Ambient {Test {Plugins {Excluded = "Search"}}}
Comments
Post a Comment