### Question:
ComponentsVm { @Command public void reindexComponent() { try { componentService.reindexComponent((Jcommune) selected); showReindexStartedNotification(); } catch (NoConnectionToJcommuneException e) { Messagebox.show(Labels.getLabel(JCOMMUNE_REINDEX_NOT_CONNECTED_TEXT), Labels.getLabel(JCOMMUNE_REINDEX_NOT_CONNECTED_TITLE), Messagebox.OK, Messagebox.ERROR); } catch (JcommuneUrlNotConfiguredException e) { Messagebox.show(Labels.getLabel(JCOMMUNE_REINDEX_NOT_CONFIGURED_TEXT), Labels.getLabel(JCOMMUNE_REINDEX_NOT_CONFIGURED_TITLE), Messagebox.OK, Messagebox.ERROR); } catch (JcommuneRespondedWithErrorException e) { Messagebox.show(Labels.getLabel(JCOMMUNE_REINDEX_ERROR_RESPONSE_TEXT) + e.getMessage(), Labels.getLabel(JCOMMUNE_REINDEX_ERROR_RESPONSE_TITLE), Messagebox.OK, Messagebox.ERROR); } } ComponentsVm(final ComponentService componentService, final WindowManager windowManager,
            final SelectedEntity<Component> selectedEntity, final ComponentList componentsToBeNotified); Component getPoulpe(); boolean isPoulpeVisible(); Component getJcommune(); boolean isJcommuneVisible(); @Command void deleteComponent(); @Command void reindexComponent(); @Command void addNewPoulpe(); @Command void addNewJcommune(); @Command void configureComponent(); @Command final void backupDatabase(); void setSelected(final Component selected); static void show(final WindowManager windowManager); boolean isJcommuneAvailable(); boolean isShowReindexStartedNotification(); final void setFileDownloadService(final FileDownloadService fileDownloadService); static final String SHOW_REINDEX_START_NOTIFICATION; static final String COMPONENTS_PAGE_LOCATION; }### Answer:
@Test public void reindexComponent() throws Exception { ComponentBase componentBase = new ComponentBase(ComponentType.FORUM); Jcommune jcommune = (Jcommune) componentBase.newComponent("Name", "Description"); componentsVm.setSelected(jcommune); componentsVm.reindexComponent(); verify(componentService).reindexComponent(jcommune); }