Olá,
Estou no capitulo de Testes em Controllers e estou tendo problemas ao executar o teste em ProductControllerTest.java (Link para código da Classe: https://goo.gl/qz0q2R revision: 818fc57)
Em princípio parece um erro no momento de obter o contexto ou de fazer a injection dos objetos, ainda não consegui descobrir onde posso estar errando.
T E S T S
Running org.casadocodigo.loja.controllers.ProductsControllerTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.999 sec <<< FAILURE!
shouldListAllBooksInTheHome(org.casadocodigo.loja.controllers.ProductsControllerTest) Time elapsed: 0.013 sec <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘productsController’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.casadocodigo.loja.infra.FileSaver org.casadocodigo.loja.controllers.ProductsController.fileSaver; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘fileSaver’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.amazonaws.services.s3.AmazonS3Client org.casadocodigo.loja.infra.FileSaver.s3; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.amazonaws.services.s3.AmazonS3Client] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Link para FULL STACK: http://pastebin.com/PKW6UrFq
Se alguém tiver uma dica, desde já agradeço. Abraço a todos.