satishkt
Feb 8th, 2010, 10:19 PM
I was hoping that I could pass in a class annotated with @Configuration into @ContextConfiguration and extending Spring's TestNG integration class which would be able to build the context from the beans defined (using @Bean) in the Configuration class.
This would have given me the benefit of loading only the essential bean dependencies that my test bean needed, injecting mocks for the ones that I cant create in a unit test and also not having to create an xml file for individual tests (I guess I would write a seperate @Configuration java file for each test, but I could use the inheritance to easily manage those).
But the @ContextConfiguration provides options only for passing in xml(s) files only. Is there a different way to achieve what I want (I did look thru the API docs but could not find anything that seems to fit my purpose).
thanks
-Satish
This would have given me the benefit of loading only the essential bean dependencies that my test bean needed, injecting mocks for the ones that I cant create in a unit test and also not having to create an xml file for individual tests (I guess I would write a seperate @Configuration java file for each test, but I could use the inheritance to easily manage those).
But the @ContextConfiguration provides options only for passing in xml(s) files only. Is there a different way to achieve what I want (I did look thru the API docs but could not find anything that seems to fit my purpose).
thanks
-Satish