I use Seam 2.2 and TestNG. I want to test some methods that delete some resources from WebDav using Sardine. The thing is that Sardine throws error if the resources could not be found where expected, so I made a MockSardineTestClass that mocks the actual delete.
The thing is that into my class is being injected a seam component WebDavClient that does the actual resource delete. My MockSardineTestClass extends WebDavClient class and i want to inject the MockSardineTestClass when running tests. How can I accomplish that? Is there a way to do a conditional injection in seam? Do you have another idea?
Also, as a general question: if I have an abstract class/interface with 2 implementations, and with seam I inject that interface how does seam evaluates which implementation should be injected?