에서 최우선 서비스하는 XPlugin.groovy에서 빈을 무시 단지() 메서드 doWithSpring에 서비스를 재정의하는 데 필요한 : 이미 내가 Grails의 3 프로그래밍을 시작Grails는 3 : Grails의 2에서 doWithSpring
def doWithSpring = {
tokenStorageService(TokenStorageProxyService) { it.autowire = 'byName' }
}
내 기존 Grails의 일부 2 플러그인의 Grails의 3 버전을 만드는거야으로, Grails의 2와 경험을 가진 새로운 플러그인에 오버라이드 (override) 같은 종류의 시도 :
Closure doWithSpring() { {->
tokenStorageService(TokenStorageProxyService) {
it.autowire = 'byName'
}
} }
을 좀 통합 테스트를했다 :
테스트를 실행하는 경우@Integration
class SecurityServiceIntegrationSpec extends Specification {
SecurityService securityService
TokenStorageProxyService tokenStorageService
...
}
, 나는 오류를 얻을 :
org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'grails.plugin.springsecurity.rest.token.storage.jwt.JwtTokenStorageService' to required type 'com.b2boost.grails3.auth.client.TokenStorageProxyService' for property 'tokenStorageService'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'grails.plugin.springsecurity.rest.token.storage.jwt.JwtTokenStorageService' to required type 'com.b2boost.grails3.auth.client.TokenStorageProxyService' for property 'tokenStorageService': no matching editors or conversion strategy found at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:605) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1620) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:400) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:119) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230) ... at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalStateException: Cannot convert value of type 'grails.plugin.springsecurity.rest.token.storage.jwt.JwtTokenStorageService' to required type 'com.b2boost.grails3.auth.client.TokenStorageProxyService' for property 'tokenStorageService': no matching editors or conversion strategy found at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:306) at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:590) ... 37 more
그것은 보인다 JwtTokenStorageService이 서비스가 통합 테스트에 유선 때 ConversionNotSupportedException 결과 내 TokenStorageProxyService에 의해 오버라이드되지 않은 기본. 내 플러그인에서 서비스를 어떻게 재정의 할 수 있습니까?