junit 测试问题 No qualifying bean of type [javax.servlet.http.HttpServletRequest] found for dependency

2018-03-08 16:49:01,539 [main] ERROR [org.springframework.boot.SpringApplication] [SpringApplication.java:827] - Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'assessAgencyController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.servlet.http.HttpServletRequest] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:311) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
	at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
	at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:98) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:228) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:230) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:249) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:193) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137) [junit-4.12.jar:4.12]
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) [junit-rt.jar:na]
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) [junit-rt.jar:na]
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) [junit-rt.jar:na]
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.servlet.http.HttpServletRequest] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:508) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:486) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:615) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:169) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:308) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	... 39 common frames omitted
2018-03-08 16:49:01,572 [main] INFO  [org.springframework.boot.logging.ClasspathLoggingApplicationListener] [ClasspathLoggingApplicationListener.java:57] - Application failed to start with classpath: [file:/D:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.0.3/lib/idea_rt.jar, file:/D:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.0.3/plugins/junit/lib/junit-rt.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/charsets.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/deploy.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/javaws.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/jce.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/jfr.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/jfxswt.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/jsse.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/management-agent.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/plugin.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/resources.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/rt.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/ext/access-bridge-64.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/ext/cldrdata.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/ext/dnsns.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/ext/jaccess.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/ext/jfxrt.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/ext/localedata.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/ext/nashorn.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/ext/sunec.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/ext/sunjce_provider.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/ext/sunmscapi.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/ext/sunpkcs11.jar, file:/C:/dev/jdk1.8.0_131/jre/lib/ext/zipfs.jar, file:/D:/cargo/za-sniper/branches/20180305_16266_1/target/test-classes/, file:/D:/cargo/za-sniper/branches/20180305_16266_1/target/classes/, file:/C:/.m2/repository/org/springframework/boot/spring-boot-starter-velocity/1.3.2.RELEASE/spring-boot-starter-velocity-1.3.2.RELEASE.jar, file:/C:/.m2/repository/org/springframework/boot/spring-boot-starter/1.3.2.RELEASE/spring-boot-starter-1.3.2.RELEASE.jar, file:/C:/.m2/repository/org/springframework/boot/spring-boot/1.3.2.RELEASE/spring-boot-1.3.2.RELEASE.jar, file:/C:/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.3.2.RELEASE/spring-boot-autoconfigure-1.3.2.RELEASE.jar, file:/C:/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.3.2.RELEASE/spring-boot-starter-logging-1.3.2.RELEASE.jar, file:/C:/.m2/repository/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar, file:/C:/.m2/repository/ch/qos/logback/logback-core/1.1.3/logback-core-1.1.3.jar, file:/C:/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.13/jcl-over-slf4j-1.7.13.jar, file:/C:/.m2/repository/org/slf4j/jul-to-slf4j/1.7.13/jul-to-slf4j-1.7.13.jar, file:/C:/.m2/repository/org/yaml/snakeyaml/1.16/snakeyaml-1.16.jar, file:/C:/.m2/repository/org/springframework/boot/spring-boot-starter-web/1.3.2.RELEASE/spring-boot-starter-web-1.3.2.RELEASE.jar, file:/C:/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/1.3.2.RELEASE/spring-boot-starter-tomcat-1.3.2.RELEASE.jar, file:/C:/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.0.30/tomcat-embed-core-8.0.30.jar, file:/C:/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.0.30/tomcat-embed-el-8.0.30.jar, file:/C:/.m2/repository/org/apache/tomcat/embed/tomcat-embed-logging-juli/8.0.30/tomcat-embed-logging-juli-8.0.30.jar, file:/C:/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/8.0.30/tomcat-embed-websocket-8.0.30.jar, file:/C:/.m2/repository/org/springframework/boot/spring-boot-starter-validation/1.3.2.RELEASE/spring-boot-starter-validation-1.3.2.RELEASE.jar, file:/C:/.m2/repository/org/springframework/spring-webmvc/4.2.4.RELEASE/spring-webmvc-4.2.4.RELEASE.jar, file:/C:/.m2/repository/commons-beanutils/commons-beanutils/1.9.2/commons-beanutils-1.9.2.jar, file:/C:/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar, file:/C:/.m2/repository/commons-digester/commons-digester/2.1/commons-digester-2.1.jar, file:/C:/.m2/repository/org/apache/velocity/velocity/1.7/velocity-1.7.jar, file:/C:/.m2/repository/org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0.jar, file:/C:/.m2/repository/commons-chain/commons-chain/1.1/commons-chain-1.1.jar, file:/C:/.m2/repository/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.jar, file:/C:/.m2/repository/oro/oro/2.0.8/oro-2.0.8.jar, file:/C:/.m2/repository/sslext/sslext/1.2-0/sslext-1.2-0.jar, file:/C:/.m2/repository/org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.jar, file:/C:/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar, file:/C:/.m2/repository/org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.jar, file:/C:/.m2/repository/org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.jar, file:/C:/.m2/repository/org/springframework/spring-context-support/4.2.4.RELEASE/spring-context-support-4.2.4.RELEASE.jar, file:/C:/.m2/repository/org/springframework/spring-beans/4.2.4.RELEASE/spring-beans-4.2.4.RELEASE.jar, file:/C:/.m2/repository/org/springframework/boot/spring-boot-starter-test/1.3.2.RELEASE/spring-boot-starter-test-1.3.2.RELEASE.jar, file:/C:/.m2/repository/junit/junit/4.12/junit-4.12.jar, file:/C:/.m2/repository/org/mockito/mockito-core/1.10.19/mockito-core-1.10.19.jar, file:/C:/.m2/repository/org/objenesis/objenesis/2.1/objenesis-2.1.jar, file:/C:/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar, file:/C:/.m2/repository/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.jar, file:/C:/.m2/repository/org/springframework/spring-core/4.2.4.RELEASE/spring-core-4.2.4.RELEASE.jar, file:/C:/.m2/repository/org/springframework/spring-test/4.2.4.RELEASE/spring-test-4.2.4.RELEASE.jar, file:/C:/.m2/repository/org/springframework/boot/spring-boot-starter-jetty/1.3.2.RELEASE/spring-boot-starter-jetty-1.3.2.RELEASE.jar, file:/C:/.m2/repository/org/eclipse/jetty/jetty-servlets/9.2.14.v20151106/jetty-servlets-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/jetty-continuation/9.2.14.v20151106/jetty-continuation-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/jetty-http/9.2.14.v20151106/jetty-http-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/jetty-util/9.2.14.v20151106/jetty-util-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/jetty-io/9.2.14.v20151106/jetty-io-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/jetty-webapp/9.2.14.v20151106/jetty-webapp-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/jetty-xml/9.2.14.v20151106/jetty-xml-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/jetty-servlet/9.2.14.v20151106/jetty-servlet-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/jetty-security/9.2.14.v20151106/jetty-security-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/jetty-server/9.2.14.v20151106/jetty-server-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/websocket/websocket-server/9.2.14.v20151106/websocket-server-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/websocket/websocket-common/9.2.14.v20151106/websocket-common-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/websocket/websocket-api/9.2.14.v20151106/websocket-api-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/websocket/websocket-client/9.2.14.v20151106/websocket-client-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/websocket/websocket-servlet/9.2.14.v20151106/websocket-servlet-9.2.14.v20151106.jar, file:/C:/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar, file:/C:/.m2/repository/org/eclipse/jetty/websocket/javax-websocket-server-impl/9.2.14.v20151106/javax-websocket-server-impl-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/jetty-annotations/9.2.14.v20151106/jetty-annotations-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/jetty-plus/9.2.14.v20151106/jetty-plus-9.2.14.v20151106.jar, file:/C:/.m2/repository/org/eclipse/jetty/jetty-jndi/9.2.14.v20151106/jetty-jndi-9.2.14.v20151106.jar, file:/C:/.m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar, file:/C:/.m2/repository/org/ow2/asm/asm-commons/5.0.1/asm-commons-5.0.1.jar, file:/C:/.m2/repository/org/ow2/asm/asm-tree/5.0.1/asm-tree-5.0.1.jar, file:/C:/.m2/repository/org/eclipse/jetty/websocket/javax-websocket-client-impl/9.2.14.v20151106/javax-websocket-client-impl-9.2.14.v20151106.jar, file:/C:/.m2/repository/javax/websocket/javax.websocket-api/1.0/javax.websocket-api-1.0.jar, file:/C:/.m2/repository/com/lisulong/za-bridge-share/1.0.68/za-bridge-share-1.0.68.jar, file:/C:/.m2/repository/com/lisulong/za-bill-share/1.0.262/za-bill-share-1.0.262.jar, file:/C:/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar, file:/C:/.m2/repository/com/alibaba/fastjson/1.2.8/fastjson-1.2.8.jar, file:/C:/.m2/repository/org/springframework/cloud/spring-cloud-starter-eureka/1.1.0.M3/spring-cloud-starter-eureka-1.1.0.M3.jar, file:/C:/.m2/repository/org/springframework/cloud/spring-cloud-starter/1.1.0.M3/spring-cloud-starter-1.1.0.M3.jar, file:/C:/.m2/repository/org/springframework/cloud/spring-cloud-context/1.1.0.M3/spring-cloud-context-1.1.0.M3.jar, file:/C:/.m2/repository/org/springframework/cloud/spring-cloud-netflix-core/1.1.0.M3.ZA.RC0/spring-cloud-netflix-core-1.1.0.M3.ZA.RC0.jar, file:/C:/.m2/repository/com/netflix/eureka/eureka-client/1.3.4/eureka-client-1.3.4.jar, file:/C:/.m2/repository/org/codehaus/jettison/jettison/1.3.7/jettison-1.3.7.jar, file:/C:/.m2/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar, file:/C:/.m2/repository/com/netflix/netflix-commons/netflix-eventbus/0.1.2/netflix-eventbus-0.1.2.jar, file:/C:/.m2/repository/com/netflix/archaius/archaius-core/0.7.1/archaius-core-0.7.1.jar, file:/C:/.m2/repository/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar, file:/C:/.m2/repository/com/netflix/servo/servo-core/0.10.0/servo-core-0.10.0.jar, file:/C:/.m2/repository/com/netflix/servo/servo-internal/0.10.0/servo-internal-0.10.0.jar, file:/C:/.m2/repository/com/sun/jersey/jersey-core/1.19/jersey-core-1.19.jar, file:/C:/.m2/repository/com/sun/jersey/jersey-client/1.19/jersey-client-1.19.jar, file:/C:/.m2/repository/com/sun/jersey/contribs/jersey-apache-client4/1.19/jersey-apache-client4-1.19.jar, file:/C:/.m2/repository/com/google/inject/guice/4.0/guice-4.0.jar, file:/C:/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/C:/.m2/repository/com/netflix/governator/governator-annotations/1.10.4/governator-annotations-1.10.4.jar, file:/C:/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.6.5/jackson-annotations-2.6.5.jar, file:/C:/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.6.5/jackson-core-2.6.5.jar, file:/C:/.m2/repository/com/netflix/ribbon/ribbon-eureka/2.1.0/ribbon-eureka-2.1.0.jar, file:/C:/.m2/repository/com/netflix/eureka/eureka2-client-shaded/2.0.0-rc.2/eureka2-client-shaded-2.0.0-rc.2.jar, file:/C:/.m2/repository/io/netty/netty-codec-http/4.0.25.Final/netty-codec-http-4.0.25.Final.jar, file:/C:/.m2/repository/io/netty/netty-codec/4.0.25.Final/netty-codec-4.0.25.Final.jar, file:/C:/.m2/repository/io/netty/netty-handler/4.0.25.Final/netty-handler-4.0.25.Final.jar, file:/C:/.m2/repository/io/netty/netty-transport-native-epoll/4.0.25.Final/netty-transport-native-epoll-4.0.25.Final.jar, file:/C:/.m2/repository/io/netty/netty-common/4.0.25.Final/netty-common-4.0.25.Final.jar, file:/C:/.m2/repository/io/netty/netty-buffer/4.0.25.Final/netty-buffer-4.0.25.Final.jar, file:/C:/.m2/repository/io/netty/netty-transport/4.0.25.Final/netty-transport-4.0.25.Final.jar, file:/C:/.m2/repository/com/thoughtworks/xstream/xstream/1.4.2/xstream-1.4.2.jar, file:/C:/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar, file:/C:/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar, file:/C:/.m2/repository/org/springframework/cloud/spring-cloud-starter-feign/1.1.0.M3/spring-cloud-starter-feign-1.1.0.M3.jar, file:/C:/.m2/repository/org/springframework/spring-web/4.2.4.RELEASE/spring-web-4.2.4.RELEASE.jar, file:/C:/.m2/repository/org/springframework/spring-aop/4.2.4.RELEASE/spring-aop-4.2.4.RELEASE.jar, file:/C:/.m2/repository/org/springframework/cloud/spring-cloud-commons/1.1.0.M3/spring-cloud-commons-1.1.0.M3.jar, file:/C:/.m2/repository/org/springframework/security/spring-security-crypto/4.0.3.RELEASE/spring-security-crypto-4.0.3.RELEASE.jar, file:/C:/.m2/repository/com/netflix/feign/feign-core/8.11.0/feign-core-8.11.0.jar, file:/C:/.m2/repository/com/netflix/feign/feign-slf4j/8.11.0/feign-slf4j-8.11.0.jar, file:/C:/.m2/repository/com/netflix/feign/feign-hystrix/8.11.0/feign-hystrix-8.11.0.jar, file:/C:/.m2/repository/org/springframework/cloud/spring-cloud-starter-ribbon/1.1.0.M3/spring-cloud-starter-ribbon-1.1.0.M3.jar, file:/C:/.m2/repository/com/netflix/ribbon/ribbon/2.1.0/ribbon-2.1.0.jar, file:/C:/.m2/repository/com/netflix/ribbon/ribbon-transport/2.1.0/ribbon-transport-2.1.0.jar, file:/C:/.m2/repository/io/reactivex/rxnetty-contexts/0.4.9/rxnetty-contexts-0.4.9.jar, file:/C:/.m2/repository/io/reactivex/rxnetty-servo/0.4.9/rxnetty-servo-0.4.9.jar, file:/C:/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar, file:/C:/.m2/repository/io/reactivex/rxnetty/0.4.9/rxnetty-0.4.9.jar, file:/C:/.m2/repository/commons-configuration/commons-configuration/1.8/commons-configuration-1.8.jar, file:/C:/.m2/repository/com/google/guava/guava/18.0/guava-18.0.jar, file:/C:/.m2/repository/com/netflix/ribbon/ribbon-core/2.1.0/ribbon-core-2.1.0.jar, file:/C:/.m2/repository/com/netflix/ribbon/ribbon-httpclient/2.1.0/ribbon-httpclient-2.1.0.jar, file:/C:/.m2/repository/com/netflix/netflix-commons/netflix-commons-util/0.1.1/netflix-commons-util-0.1.1.jar, file:/C:/.m2/repository/com/netflix/ribbon/ribbon-loadbalancer/2.1.0/ribbon-loadbalancer-2.1.0.jar, file:/C:/.m2/repository/com/netflix/netflix-commons/netflix-statistics/0.1.1/netflix-statistics-0.1.1.jar, file:/C:/.m2/repository/io/reactivex/rxjava/1.0.11/rxjava-1.0.11.jar, file:/C:/.m2/repository/org/springframework/cloud/spring-cloud-starter-config/1.1.0.M3/spring-cloud-starter-config-1.1.0.M3.jar, file:/C:/.m2/repository/org/springframework/cloud/spring-cloud-config-client/1.1.0.M3/spring-cloud-config-client-1.1.0.M3.jar, file:/C:/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.6.5/jackson-databind-2.6.5.jar, file:/C:/.m2/repository/org/springframework/cloud/spring-cloud-starter-hystrix/1.1.0.M3/spring-cloud-starter-hystrix-1.1.0.M3.jar, file:/C:/.m2/repository/com/netflix/hystrix/hystrix-core/1.4.20/hystrix-core-1.4.20.jar, file:/C:/.m2/repository/com/netflix/hystrix/hystrix-metrics-event-stream/1.4.20/hystrix-metrics-event-stream-1.4.20.jar, file:/C:/.m2/repository/com/netflix/hystrix/hystrix-javanica/1.4.20/hystrix-javanica-1.4.20.jar, file:/C:/.m2/repository/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar, file:/C:/.m2/repository/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar, file:/C:/.m2/repository/org/springframework/cloud/spring-cloud-starter-zuul/1.1.0.M3/spring-cloud-starter-zuul-1.1.0.M3.jar, file:/C:/.m2/repository/org/springframework/boot/spring-boot-starter-actuator/1.3.2.RELEASE/spring-boot-starter-actuator-1.3.2.RELEASE.jar, file:/C:/.m2/repository/org/springframework/boot/spring-boot-actuator/1.3.2.RELEASE/spring-boot-actuator-1.3.2.RELEASE.jar, file:/C:/.m2/repository/com/netflix/zuul/zuul-core/1.1.0-rc.1/zuul-core-1.1.0-rc.1.jar, file:/C:/.m2/repository/org/projectlombok/lombok/1.16.6/lombok-1.16.6.jar, file:/C:/.m2/repository/com/taobao/tair/tair-client/2.3.4.43/tair-client-2.3.4.43.jar, file:/C:/.m2/repository/org/apache/mina/mina-core/1.1.5/mina-core-1.1.5.jar, file:/C:/.m2/repository/com/taobao/eagleeye/eagleeye-core/1.2.4/eagleeye-core-1.2.4.jar, file:/C:/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar, file:/C:/.m2/repository/org/slf4j/slf4j-log4j12/1.7.13/slf4j-log4j12-1.7.13.jar, file:/C:/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar, file:/C:/.m2/repository/org/slf4j/slf4j-api/1.7.13/slf4j-api-1.7.13.jar, file:/C:/.m2/repository/com/taobao/common/monitor/common-monitor/1.2.1/common-monitor-1.2.1.jar, file:/C:/.m2/repository/com/taobao/common/smonitor/smonitor/1.0.7.2/smonitor-1.0.7.2.jar, file:/C:/.m2/repository/org/xerial/snappy/snappy-java/1.0.4/snappy-java-1.0.4.jar, file:/C:/.m2/repository/org/apache/commons/commons-compress/1.3/commons-compress-1.3.jar, file:/C:/.m2/repository/com/aliyun/openservices/aliyun-openservices/1.0.12/aliyun-openservices-1.0.12.jar, file:/C:/.m2/repository/org/apache/httpcomponents/httpclient/4.5.1/httpclient-4.5.1.jar, file:/C:/.m2/repository/org/apache/httpcomponents/httpcore/4.4.4/httpcore-4.4.4.jar, file:/C:/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9.jar, file:/C:/.m2/repository/org/jdom/jdom/1.1/jdom-1.1.jar, file:/C:/.m2/repository/com/taobao/util/util/1.2.6/util-1.2.6.jar, file:/C:/.m2/repository/org/powermock/powermock-module-junit4/1.6.3/powermock-module-junit4-1.6.3.jar, file:/C:/.m2/repository/org/powermock/powermock-module-junit4-common/1.6.3/powermock-module-junit4-common-1.6.3.jar, file:/C:/.m2/repository/org/powermock/powermock-core/1.6.3/powermock-core-1.6.3.jar, file:/C:/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar, file:/C:/.m2/repository/org/powermock/powermock-reflect/1.6.3/powermock-reflect-1.6.3.jar, file:/C:/.m2/repository/org/powermock/powermock-api-mockito/1.6.3/powermock-api-mockito-1.6.3.jar, file:/C:/.m2/repository/org/mockito/mockito-all/1.10.19/mockito-all-1.10.19.jar, file:/C:/.m2/repository/org/powermock/powermock-api-support/1.6.3/powermock-api-support-1.6.3.jar, file:/C:/.m2/repository/com/lisulong/za-sso-client-share/1.0.20/za-sso-client-share-1.0.20.jar, file:/C:/.m2/repository/com/lisulong/za-fcp-feignclient-share/1.0.0/za-fcp-feignclient-share-1.0.0.jar, file:/C:/.m2/repository/com/lisulong/za-fcp-common-share/1.0.0/za-fcp-common-share-1.0.0.jar, file:/C:/.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar, file:/C:/.m2/repository/com/lisulong/za-kafka-clients/0.9.1/za-kafka-clients-0.9.1.jar, file:/C:/.m2/repository/org/apache/kafka/kafka_2.11/0.10.2.1/kafka_2.11-0.10.2.1.jar, file:/C:/.m2/repository/org/apache/kafka/kafka-clients/0.10.2.1/kafka-clients-0.10.2.1.jar, file:/C:/.m2/repository/net/jpountz/lz4/lz4/1.3.0/lz4-1.3.0.jar, file:/C:/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.3/jopt-simple-5.0.3.jar, file:/C:/.m2/repository/com/yammer/metrics/metrics-core/2.2.0/metrics-core-2.2.0.jar, file:/C:/.m2/repository/org/scala-lang/scala-library/2.11.8/scala-library-2.11.8.jar, file:/C:/.m2/repository/com/101tec/zkclient/0.10/zkclient-0.10.jar, file:/C:/.m2/repository/org/apache/zookeeper/zookeeper/3.4.9/zookeeper-3.4.9.jar, file:/C:/.m2/repository/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.4/scala-parser-combinators_2.11-1.0.4.jar, file:/C:/.m2/repository/org/springframework/spring-context/4.2.4.RELEASE/spring-context-4.2.4.RELEASE.jar, file:/C:/.m2/repository/org/springframework/spring-expression/4.2.4.RELEASE/spring-expression-4.2.4.RELEASE.jar, file:/C:/.m2/repository/com/lisulong/za-cargo-share/1.0.140/za-cargo-share-1.0.140.jar, file:/C:/.m2/repository/com/lisulong/common-share/1.0.9/common-share-1.0.9.jar, file:/C:/.m2/repository/com/lisulong/za-cdc-share/1.0.138/za-cdc-share-1.0.138.jar, file:/C:/.m2/repository/com/lisulong/za-claim-share/1.0.177/za-claim-share-1.0.177.jar, file:/C:/.m2/repository/com/belerweb/pinyin4j/2.5.0/pinyin4j-2.5.0.jar, file:/C:/.m2/repository/com/aliyun/openservices/ons-client/1.3.2.Final/ons-client-1.3.2.Final.jar, file:/C:/.m2/repository/com/aliyun/openservices/ons-api/1.3.2.Final/ons-api-1.3.2.Final.jar, file:/C:/.m2/repository/org/apache/poi/poi/3.10-FINAL/poi-3.10-FINAL.jar, file:/C:/.m2/repository/org/apache/poi/ooxml-schemas/1.1/ooxml-schemas-1.1.jar, file:/C:/.m2/repository/org/apache/xmlbeans/xmlbeans/2.3.0/xmlbeans-2.3.0.jar, file:/C:/.m2/repository/org/apache/poi/poi-ooxml/3.10-FINAL/poi-ooxml-3.10-FINAL.jar, file:/C:/.m2/repository/org/apache/poi/poi-ooxml-schemas/3.10-FINAL/poi-ooxml-schemas-3.10-FINAL.jar, file:/C:/.m2/repository/com/lisulong/za-platform-share/1.0.246/za-platform-share-1.0.246.jar, file:/C:/.m2/repository/com/lisulong/za-openapi-share/1.0.37/za-openapi-share-1.0.37.jar, file:/C:/.m2/repository/com/lisulong/za-card-share/1.0.27/za-card-share-1.0.27.jar, file:/C:/.m2/repository/com/lisulong/za-user-share/1.0.342/za-user-share-1.0.342.jar, file:/C:/.m2/repository/com/lisulong/za-dispatcher-share/1.0.2/za-dispatcher-share-1.0.2.jar, file:/C:/.m2/repository/com/taobao/hsf/hsf.notify.spring/1.4.9.6/hsf.notify.spring-1.4.9.6.jar, file:/C:/.m2/repository/com/taobao/notify/notify-tr-client/1.8.15/notify-tr-client-1.8.15.jar, file:/C:/.m2/repository/com/taobao/notify/notify-utils/1.8.15/notify-utils-1.8.15.jar, file:/C:/.m2/repository/bcel/bcel/5.1/bcel-5.1.jar, file:/C:/.m2/repository/regexp/regexp/1.2/regexp-1.2.jar, file:/C:/.m2/repository/hessian/hessian/3.1.2/hessian-3.1.2.jar, file:/C:/.m2/repository/org/jasypt/jasypt/1.5/jasypt-1.5.jar, file:/C:/.m2/repository/com/ibm/icu/icu4j/3.4.4/icu4j-3.4.4.jar, file:/C:/.m2/repository/com/googlecode/aviator/aviator/2.2.1/aviator-2.2.1.jar, file:/C:/.m2/repository/com/h2database/h2/1.4.190/h2-1.4.190.jar, file:/C:/.m2/repository/org/jdbi/jdbi/2.38.1/jdbi-2.38.1.jar, file:/C:/.m2/repository/com/taobao/notify/notify-common/1.8.15/notify-common-1.8.15.jar, file:/C:/.m2/repository/com/taobao/notify/notify-remoting/1.8.15/notify-remoting-1.8.15.jar, file:/C:/.m2/repository/com/taobao/gecko/gecko/1.1.4-SNAPSHOT/gecko-1.1.4-20130402.020205-1.jar, file:/C:/.m2/repository/com/taobao/notify/notify-store4j/1.8.15/notify-store4j-1.8.15.jar, file:/C:/.m2/repository/com/google/code/gson/gson/2.3.1/gson-2.3.1.jar, file:/C:/.m2/repository/com/google/protobuf/protobuf-java/2.3.0/protobuf-java-2.3.0.jar, file:/C:/.m2/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar, file:/C:/.m2/repository/net/sf/json-lib/json-lib/2.4/json-lib-2.4-jdk15.jar, file:/C:/.m2/repository/org/aspectj/aspectjrt/1.8.8/aspectjrt-1.8.8.jar, file:/C:/.m2/repository/org/aspectj/aspectjweaver/1.8.8/aspectjweaver-1.8.8.jar, file:/C:/.m2/repository/net/sf/oval/oval/1.81/oval-1.81.jar, file:/C:/.m2/repository/com/lisulong/za-teresa-share/1.0.84/za-teresa-share-1.0.84.jar, file:/C:/.m2/repository/com/lisulong/za-skystars-share/1.0.64/za-skystars-share-1.0.64.jar, file:/C:/.m2/repository/com/lisulong/za-doc-share/1.0.243/za-doc-share-1.0.243.jar, file:/C:/.m2/repository/com/taobao/common/dao/common-dao/1.0.3/common-dao-1.0.3.jar, file:/C:/.m2/repository/com/jcraft/jsch/0.1.50/jsch-0.1.50.jar, file:/C:/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar, file:/C:/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar, file:/C:/.m2/repository/commons-io/commons-io/2.3/commons-io-2.3.jar, file:/C:/.m2/repository/com/lisulong/za-policy-share/1.0.322/za-policy-share-1.0.322.jar, file:/C:/.m2/repository/com/lisulong/za-product-share/1.0.176/za-product-share-1.0.176.jar, file:/C:/.m2/repository/com/itextpdf/itextpdf/5.5.5/itextpdf-5.5.5.jar, file:/C:/.m2/repository/com/itextpdf/itext-asian/5.2.0/itext-asian-5.2.0.jar, file:/C:/.m2/repository/com/lowagie/itext/2.1.7/itext-2.1.7.jar, file:/C:/.m2/repository/bouncycastle/bcmail-jdk14/138/bcmail-jdk14-138.jar, file:/C:/.m2/repository/bouncycastle/bcprov-jdk14/138/bcprov-jdk14-138.jar, file:/C:/.m2/repository/org/bouncycastle/bctsp-jdk14/1.38/bctsp-jdk14-1.38.jar, file:/C:/.m2/repository/org/bouncycastle/bcprov-jdk14/1.38/bcprov-jdk14-1.38.jar, file:/C:/.m2/repository/org/bouncycastle/bcmail-jdk14/1.38/bcmail-jdk14-1.38.jar, file:/C:/.m2/repository/com/yucheng/iTextAsian/1.0.0-SNAPSHOT/iTextAsian-1.0.0-SNAPSHOT.jar, file:/C:/.m2/repository/com/lowagie/itext-rtf/2.1.7/itext-rtf-2.1.7.jar]
2018-03-08 16:49:01,634 [main] ERROR [org.springframework.test.context.TestContextManager] [TestContextManager.java:231] - Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@73eb439a] to prepare test instance [com.lisulong.sniper.biz.bops.BusinessDetailServiceTest@51f68849]
java.lang.IllegalStateException: Failed to load ApplicationContext
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:228) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:230) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:249) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:193) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137) [junit-4.12.jar:4.12]
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) [junit-rt.jar:na]
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) [junit-rt.jar:na]
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) [junit-rt.jar:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'assessAgencyController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.servlet.http.HttpServletRequest] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:311) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
	at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
	at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:98) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	... 23 common frames omitted
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.servlet.http.HttpServletRequest] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:508) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:486) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:615) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:169) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:308) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	... 39 common frames omitted

java.lang.IllegalStateException: Failed to load ApplicationContext
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
	at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:228)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:230)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:249)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:193)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'assessAgencyController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.servlet.http.HttpServletRequest] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:311)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
	at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
	at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:98)
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
	... 23 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.servlet.http.HttpServletRequest] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:508)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:486)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:615)
	at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:169)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:308)
	... 39 more

找了半天的 
结果在 
https://stackoverflow.com/questions/17619029/spring-junit-test-case-failed

发现原因

The error is in the stack trace

Could not autowire field: private javax.servlet.http.HttpServletRequest com.myapp.controller.ProductController.request; … No matching bean of type [javax.servlet.http.HttpServletRequest] 
The problem is that simple Spring tests run with the bare Spring apprlication context, without Spring Web Application context capabilities. So HttpServletRequests, Servlet Context and other features are not available in this case.

Try adding @WebAppConfiguration annotation to the test class.

Please note, that this option is available only in Spring 3.2+ versions.

In the older versions of Spring you’ll need to invent something to make this interface implementations available in the application context(the most straightforward thing is to expose MockServletContext class and/or HttpServletRequest interface as beans for tests).

Also please note that the code that uses session scope beans is usually controller specific and belongs to web application context and I believe that it will be the best practice to test controllers in separate tests with the @WebAppConfiguration, but leave the tests of the plain old beans and services belonging to the root application context in the simple application contexts, i.e. without @WebAppConfiguration.

Just to be clear ProductDAO belongs to the root application context, and ProductController belongs to the web application context, so their definitions should be placed in different xml files. ProductDAO test should point to the xml of the root app context only and contain no @WebAppConfiguration.

As for ProductController test should point to both root app context and web app context xml files (see How to Setup web application context in Spring MVC test for examples) and be annotated with @WebAppConfiguration

加上@WebAppConfiguration 

引用中提到了一种问题解决方法,当使用Junit单元测试时,如果将待加载到Spring容器中且被@Configuration注解修饰的配置类定义为单元测试类的内部类,会导致解析失败。解决方法是将相关内部类移动到单元测试类的外部。例如,在示例代码中,将Config、Bean1和Bean2类移到TestApplicationContext类的外部。 引用中给出了一个测试AnnotationConfigApplicationContext()方法的示例代码。该代码演示了如何使用AnnotationConfigApplicationContext容器,并通过@Configuration注解定义了一个配置类Config,其中定义了两个Bean:Bean1和Bean2。 引用中提到了一个异常:org.springframework.beans.factory.NoSuchBeanDefinitionException,该异常表示找不到匹配类型的Bean。这可能是因为在Spring容器中找不到与指定的类型匹配的Bean定义。 综上所述,问题中的异常Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.example.demo的产生可能是因为在Spring容器中找不到匹配指定类型的Bean。您可以检查您的配置类和组件扫描是否正确,并确保正确加载了所需的Bean定义。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [Caused by:org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type](https://blog.csdn.net/qq_38505969/article/details/123751384)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *3* [Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.Transformer异常](https://download.csdn.net/download/weixin_38642864/12723222)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值