train_findFieldsWithAnnotation(ct, InjectComponent.class, "myfield");
train_getFieldAnnotation(ct, "myfield", InjectComponent.class, annotation);
train_getFieldType(ct, "myfield", CLASS_NAME);
train_getResourcesFieldName(ct, "resources");
expect(annotation.value()).andReturn("id_provided_as_annotation").atLeastOnce();
ct.makeReadOnly("myfield");
ct.extendMethod(same(TransformConstants.CONTAINING_PAGE_DID_LOAD_SIGNATURE),
contains(
"myfield = (" + CLASS_NAME + ") resources.getEmbeddedComponent(\"id_provided_as_annotation\");"));