I'm writing a web services client using Spring-WS and the WebServiceTemplate class. Down in the bowls of the WebServiceTemplate class, a WebServiceConnection is created. WebServiceConnection.send is used to actually send the message. What I'd like to do is intercept the call to WebServiceConnection.send and replace it with some logic that examines the object passed to WebServiceConnetion.send.
It strikes me that this would be a good place to use Aspects. However, I'm not sure how I can have the aspects run only when I'm executing the unit tests. I would also like to have a different aspects run based on what tests I'm executing.
Anyone have any ideas on how to do this?