PerspectiveEditorReportingGroupProvider implements PerspectiveEditorComponentGroupProvider { @Override public LayoutDragComponentGroup getComponentGroup() { LayoutDragComponentGroup group = new LayoutDragComponentGroup(getName()); addComponent(BARCHART, group, i18n.drag_component_name_barchart(), BarChartDragComponent.class); addComponent(PIECHART, group, i18n.drag_component_name_piechart(), PieChartDragComponent.class); addComponent(LINECHART, group, i18n.drag_component_name_linechart(), LineChartDragComponent.class); addComponent(AREACHART, group, i18n.drag_component_name_areachart(), AreaChartDragComponent.class); addComponent(BUBBLECHART, group, i18n.drag_component_name_bubblechart(), BubbleChartDragComponent.class); addComponent(METERCHART, group, i18n.drag_component_name_meterchart(), MeterChartDragComponent.class); addComponent(MAP, group, i18n.drag_component_name_mapchart(), MapChartDragComponent.class); addComponent(METRIC, group, i18n.drag_component_name_metric(), MetricDragComponent.class); addComponent(TABLE, group, i18n.drag_component_name_table(), TableDragComponent.class); addComponent(SELECTOR, group, i18n.drag_component_name_filter(), SelectorDragComponent.class); return group; } @Inject  PerspectiveEditorReportingGroupProvider(SyncBeanManager beanManager, 
                                                   RendererManager rendererManager); @Override String getName(); @Override LayoutDragComponentGroup getComponentGroup();  }
@Test public void groupShouldBeEmptyWhenTheresNoRendererTest() { LayoutDragComponentGroup componentGroup = perspectiveEditorReportingGroupProvider.getComponentGroup(); assertTrue(componentGroup.getLayoutDragComponentIds().isEmpty()); }
@Test public void groupShouldHaveNComponentWhenTheresRendererTest() { when(rendererManager.isTypeSupported(DisplayerType.BARCHART)).thenReturn(true); when(rendererManager.isTypeSupported(DisplayerType.LINECHART)).thenReturn(true); LayoutDragComponentGroup componentGroup = perspectiveEditorReportingGroupProvider.getComponentGroup(); assertEquals(componentGroup.getLayoutDragComponentIds().size(), 2); }