GrailsApplication app = new DefaultGrailsApplication(new Class[0], gcl);
MockApplicationContext parent = new MockApplicationContext();
parent.registerMockBean(GrailsApplication.APPLICATION_ID, app);
GrailsRuntimeConfigurator conf = new GrailsRuntimeConfigurator(app,parent);
GrailsApplicationContext ctx = (GrailsApplicationContext)conf.configure(new MockServletContext());
assertNotNull(ctx);
ctx.registerSingleton("Test", dc);
GroovyObject testInstance = getBean(ctx, "Test");
assertNotNull(testInstance);
// now test override bean
gcl = new GroovyClassLoader();
dc = gcl.parseClass("class Test { Long id; Long version;String updatedProp = 'hello'; }");
ctx.registerSingleton("Test",dc);
testInstance = getBean(ctx, "Test");
assertNotNull(testInstance);
assertEquals("hello",testInstance.getProperty("updatedProp"));
}