### Question:
ContentBeansService { public void createBeans() throws RepositoryException { final Map<String, Path> existing = findExitingBeans(); final List<HippoContentBean> missingBeans = Lists.newArrayList(filterMissingBeans(existing)); final Iterator<HippoContentBean> missingBeanIterator = missingBeans.iterator(); for (; missingBeanIterator.hasNext(); ) { final HippoContentBean missingBean = missingBeanIterator.next(); final Set<String> superTypes = missingBean.getSuperTypes(); if (superTypes.size() == 1 && superTypes.iterator().next().equals(BASE_COMPOUND_TYPE)) { createBaseBean(missingBean); missingBeanIterator.remove(); } else { final String parent = findExistingParent(missingBean, existing); if (parent != null) { log.debug("found parent: {}, {}", parent, missingBean); missingBeanIterator.remove(); createBean(missingBean, existing.get(parent)); } } } processMissing(missingBeans); processProperties(); final Iterator<HippoContentBean> extendedMissing = filterMissingBeans(findExitingBeans()); final boolean hasNonCreatedBeans = extendedMissing.hasNext(); if (missingBeansDepth < MISSING_DEPTH_MAX && hasNonCreatedBeans) { missingBeansDepth++; createBeans(); } else if (hasNonCreatedBeans) { log.error("Not all beans were created: {}", extendedMissing); } } ContentBeansService(final PluginContext context, final EventBus eventBus); void createBeans(); final Set<HippoContentBean> getContentBeans(); Set<ContentType> getProjectContentTypes(); Map<String, Path> getExistingImageTypes(); @SuppressWarnings("rawtypes") void convertImageMethods(final String newImageNamespace); static final String HIPPO_GALLERY_IMAGE_SET_BEAN; static final String HIPPO_GALLERY_IMAGE_SET_CLASS; static final String MSG_ADDED_METHOD; static final String CONTEXT_BEAN_DATA; static final String CONTEXT_BEAN_IMAGE_SET; }### Answer:
@Test public void testCreateBeans() throws Exception { final TestPluginContext context = getTestContext(); context.addPlaceholderData(EssentialConst.INSTRUCTION_UPDATE_IMAGE_SETS, "true"); final HippoRepository repository = HippoRepositoryFactory.getHippoRepository("rmi: context.setUseHippoSession(true); context.setHippoRepository(repository); System.setProperty(EssentialConst.PROJECT_BASEDIR_PROPERTY, "/home/machak/java/projects/hippo/testproject"); final ContentBeansService contentBeansService = new ContentBeansService(context, new EventBus("Test")); contentBeansService.createBeans(); contentBeansService.convertImageMethods("testproject:testasasasas"); }