The API is bit confusing: registerSingleton() on StaticWebApplicationContext
takes a class, but registerSingleton() on ConfigurableListableBeanFactory
takes a bean. That is why I first call getBeanFactory() in my example.


I use StaticWebApplicationContext for my unit testing, so I am pretty sure
it works. :)

Here is the registerSingleton signature:,%20java.lang.Object%29

Jochen Mader-2 wrote:
> Sorry for my late answer.
> StaticWebApplicationContext doesn't cut it for  me.
> Your example contains a small mistake:
> Inserting the mock-object won't work as registerSingleton expects to get a
> Class.
> As I want to create mock objects with EasyMock there are two approaches
> (as
> far as I know).
> The one I have shown before, involving the creation of the custom
> ApplicationContextMock or using easy mock inside a testing-spring.xml.
> CU
> Jochen

View this message in context:
Sent from the Wicket - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to