Hi all,

This is probably more of a Spring question than a Wicket question, but I'm
asking here in the hopes that someone else has done this before. Basically,
we have a page that uses the @SpringBean annotation to inject a credit card
validation service. At the moment, when we're developing, it's injecting the
actual service, that then goes off to our card processor and validates the
card etc. For integration testing etc. I want to avoid this, so I've created
a simple implementation of the validation service that always returns true.
Question I have, is how can I provide this bean instead of the real bean,
based on the value of WebApplication.getConfigurationType()?

The obvious solution for me would be to do it in the initialization of our
WicketApplication - we already have a "if we're in development mode" section
where we output component paths and turn on request logging and session size
recording etc. is there a way I can programmatically provide my bean at this
point? Or am I going about this entirely the wrong way?

Many thanks for any advice offered,

Regards,

Liam Clarke

Reply via email to