classSource = new CtClassSourceImpl(classFactoryClassPool, loader);
}
private Object transform(Class componentClass, ComponentClassTransformWorker worker) throws Exception
{
InternalComponentResources resources = mockInternalComponentResources();
CtClass targetObjectCtClass = findCtClass(componentClass);
Logger logger = mockLogger();
MutableComponentModel model = mockMutableComponentModel(logger);
replay();
InternalClassTransformation ct = new InternalClassTransformationImpl(classFactory, targetObjectCtClass,
new ComponentClassCacheImpl(classFactory, null), model, classSource);
worker.transform(ct, model);
ct.finish();
Instantiator instantiator = ct.createInstantiator();
Component instance = instantiator.newInstance(resources);
verify();
expect(resources.getComponent()).andReturn(instance).anyTimes();
replay();
// Return the instance for further testing