String name = getUniqueName();
DefinitionService ds = Aura.getDefinitionService();
DefDescriptor<ComponentDef> newDesc = ds.getDefDescriptor("builderComponent:"+name, ComponentDef.class);
ComponentDefRefBuilder contents = Aura.getBuilderService().getComponentDefRefBuilder();
contents.setDescriptor(ds.getDefDescriptor("componentTest:builderInjected", ComponentDef.class));
ComponentDefBuilder builder = Aura.getBuilderService().getComponentDefBuilder();
builder.setDescriptor(newDesc);
builder.setDescription("A custom built component");
List<ComponentDefRef> body = Lists.newArrayList();
body.add(contents.build());
builder.setFacet("body", body);
ds.getDefRegistry().addLocalDef(builder.build());
ComponentConfig cc = new ComponentConfig();
cc.setDescriptor(newDesc);
return cc;
}