title: dynamically declare beans at runtime in Spring
body: <p>I am wondering if the following is possible.  For testing purposes, I wish for different mock classes to be declared in the application context for different tests.  These are acceptance tests, using the Jersey REST client.  Is there a way to dynamically declare a bean at runtime?  Does Spring have an API to allow changes to the application context after the context has been loaded?</p>